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 smalle
Phew, I just solved it in java. My "smallest number with 2^n divisors" ended up being represented as a map of primes and their powers.
This puzzle is as much about optimization as anything: get your code working and then refactor hard. It's definitely worth testing up to about 2^30 divisors as there is room for all sorts of second-order bugs to creep in when optimizing. Re-use the results of earlier calculations, try not to sort anything, and stop iterating as soon as you can (NavigableSet and LinkedHashMap were useful). I'm not going to teach my grandmother to efficiently test for primality.
I used java long throughout, but with numbers of this size it's easy to go over Long.MAX_VALUE in the middle of a calculation, remember: (A^2 * B) % C = (A * ((A * B) % C)) % C.
Hope all this motivates rather than gives the game away. Keep going!