Project Euler Problem #500

805 Views Asked by At

I need help solving Project Euler Problem #500 I was unable to find discussion on this topic. My approach to solve it is to use prime factorization of an unknown number, i.e. the answer, as

$$x = 2^{a_1}\cdot3^{a_2}\cdot5^{a_3}\cdot...n^{a_n} \tag{1}$$

so the number of divisors $$k = (a_1+1)(a_2+1)(a_3+1)...(a_n+1) \tag{2}$$

Let's take a look at number $120=2^3\cdot3\cdot5$ so it has $k=(3+1)(1+1)(1+1)= 4\cdot2\cdot2=16$

Now I need to find in reverse. I have $k=2^{500500}$ or

$$k = (a_1+1)(a_2+1)(a_3+1)...(a_n+1) = 2^{500500} \tag{2'}$$

It means that $(a_n+1)=2^{y_n}$ or $a_n=2^{y_n}-1$ or from (1)

$$x=2^{2^{y_1}-1}\cdot3^{2^{y_2}-1}\cdot5^{2^{y_1}-1}\cdot...n^{2^{y_n}-1}$$

What is the criteria for minimum number with this number of divisors?

1

There are 1 best solutions below

0
On

You are asked for the smallest number with $2^{500500}$ divisors. That's a huge number!

The number $p^a q^b r^c$ for example has $(a+1)(b+1)(c+1)$ divisors. So multiplying the prime exponents + 1 gives $2^{500500}$.

The number $p^{2^a-1} q^{2^b-1} r^{2^c-1}$ has $2^a 2^b 2^c = 2^{a+b+c}$ divisors. So the exponents of the primes all have the form $2^k-1$, and each exponent contributes k to the exponent of 500,500.

The number could be the product of the first 500,500 primes. But we can find a smaller number. Instead of a factor $2^1$ we can use $2^3$ and remove the largest prime from the product. Or use $2^7$ and remove the two largest primes, or use $2^{15}$ and remove the three largest primes, etc. Same for the exponents of 3, 5, 7, 9. If p is around the 500,500th prime, you would use a factor $q^3$ for $q^2 < p$, you would use $q^7$ instead of $q^3$ if $q^4 < p$, and so on.

You need to do this quite carefully. Guessing that the 500,500th prime is around 10 million, the smallest number with $2^500500$ divisors would be around $2^{31} 3^{15} 5^{15} 7^{15} 11^7 ... 53^7 59^3 61^3 ... ≈3000^3 ≈3020^1 ... ≈10000000^1$. You can figure out the exact number.

And then you calculate the product modulo this number. And then you don't submit this because that's cheating.