luogu P1463 [HAOI2007] Inverse primes (mathematics)

luogu P1463 [HAOI2007] Anti-prime number

Description
For any positive integer x, the number of its divisors is denoted as g(x) (for example, g(1)=1, g(6)=4)
if a positive integer x satisfies: g(x)>g (i) 0<i<x, then x is called an inverse prime (for example, the integers 1, 2, 4, 6, etc. are all inverse primes)
Now given a number N, you can find the largest inverse that does not exceed N Prime numbers?

Hint
should be divided into several parts to explain one by one

Reduction Theorem
We set $P$ to be a set of prime numbers, that is, $P\={2,3,5,7,9…}$
, then for any positive integer N greater than 1, there exists a set $A$ such that $$ N\=\prod {i\=1}^{k} {P_i}^{A_i}\={P_1}^{A_1}*{P_2}^{A_2}*…*{P_k}^{A_k}$ $
That is to decompose the prime factors of
N, then the number of divisors of N is the number of different numbers obtained by multiplying several prime factors of N.
Because they are all prime numbers multiplied, as long as one element is different, we get The result is different
. For $P_i$, we can take out $0, 1, 2, 3...A_i$. According to the multiplication principle, the number of divisors of N $$g(N)\=\prod
{i\=1 }^{k} (A_i+1)\=(A_1+1)(A_2+1)…(A_k+1)$$

In fact, there are some interesting theorems about approximation, here is a blog of a big guy

According to
the definition of inverse prime numbers, a number N is an inverse prime number, indicating that $\forall 0<ig(i)$, that is, the number of divisors of N is the largest among 1~N,
then for a number N, if there is $ \exists i<j, A_i<A_j$, then N is not an inverse prime.
Proof Suppose that after exchanging $A_i, A_j$, the new result is M, then the number of divisors of M is equal to N, and it is necessary to prove that N is not an inverse prime, Just prove M1$$, and a>b, d>c, the conclusion is established.
Then the set A of N decreases
, so we enumerate each prime index to search for the largest answer

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=325873139&siteId=291194637