Sep-02-2019, 02:50 PM
It can certainly be done. I've been trying to figure an easier way than this, but here is one certain way:
1. create a list. The elements of this list will reflect the individual digits of your number. Initialize this list to 2.
2. Calculate 2**34.
3. Create a loop 1 to 2**34. In that loop you will multiply the current value (represented by the list) by 2. You will perform the multiplication the way you did in 3rd grade - multiply by the first digit, if greater than 10 then subtract 10 to keep the digit in range and carry the 1. Then multiply the next digit and add the carry until you have multiplied by all the digits. If there is a carry on the last digit add an element with the value of the carry (1).
4. Test this with a short loop to make sure it is working properly. Looping to 4 should give you a list of (6,1). Looping to 8 should give a list of (8,2,1).
5. Once this process is debugged, run it for the full loop overnight. It will take that long no matter how much memory you have. A fast processor will help.
6. 12 largest digits are the last 12 elements of the list, 12 smallest are the first 12.
That is -A- way to do it. I bet there are better, but I have not found one.
1. create a list. The elements of this list will reflect the individual digits of your number. Initialize this list to 2.
2. Calculate 2**34.
3. Create a loop 1 to 2**34. In that loop you will multiply the current value (represented by the list) by 2. You will perform the multiplication the way you did in 3rd grade - multiply by the first digit, if greater than 10 then subtract 10 to keep the digit in range and carry the 1. Then multiply the next digit and add the carry until you have multiplied by all the digits. If there is a carry on the last digit add an element with the value of the carry (1).
4. Test this with a short loop to make sure it is working properly. Looping to 4 should give you a list of (6,1). Looping to 8 should give a list of (8,2,1).
5. Once this process is debugged, run it for the full loop overnight. It will take that long no matter how much memory you have. A fast processor will help.
6. 12 largest digits are the last 12 elements of the list, 12 smallest are the first 12.
That is -A- way to do it. I bet there are better, but I have not found one.