The product of the first 7 primes = 2*3*5*7*11*13*17 = 510510, simply loop through numbers, n, till 510510, calculate the divisors of n^2. The first n we find such that the number of divisors > 2000 is the n we are looking for.
Also incase you didn't get why we are using 2000, instead of the problem 1000, is because each divisor pair is counted twice
Enter a number (yourinput)
Code will output the minimal n which has more than yourinput distinct solutions