From Project Euler problem 500
The number of divisors of 120 is 16. In fact 120 is the smallest number having 16 divisors.
Find the smallest number with 2**500500 divisors. Give your answer modulo 500500507.
It's simple enough to count the divisors of n, eg. in Python len([i for i in range(1,n+1) if n % i == 0])
. This is O(n).
I tried brute force search and found the smallest number with 32 divisors is 840, but it's much too slow for the problem above. From the inequality count_divisors(n) <= n
, the number is going to be massive.
What do you think? Any ideas? How to calculate smallest number with certain number of divisors?
Edit: I don't think this is a duplicate. This question is more specific, it concerns a particular class of much larger numbers. The other question asks generally. Its answers aren't applicable to this problem, it's a different magnitude.
d0<d1
are the value ofn=LCM(all divisors)
not only increasing ... for example ford=5
divisors the lowestn=16
and ford=6
divisors lowestn=12
!!! – Basswood