Sep-01-2019, 12:56 PM
(This post was last modified: Sep-01-2019, 01:03 PM by anabeatriz.)
(Sep-01-2019, 02:15 AM)jefsummers Wrote: So I understand the problem, is it (2**2)**34 or 2**(2**34)? The way written it would be the former which would be 4**34 as a first step
It's 2**(2**34)
(Sep-01-2019, 03:41 AM)ichabod801 Wrote: If it was as easy as calculating the number and converting it to a string, I expect your professor would not have given you until December to solve it. Especially not if it's crashing Pycharm. Note that if you only care about the last 12 digits, you only need to keep the last 12 digits. You could keep trimming off the extra digits, and use a loop to calculate the right number of multiplications. You will probably need to break down the number to keep the number of loops you need to do down.
The higher end would be trickier, since the lower digits still multiply and can thus bleed up into the higher digits. I would look at the higher powers of 2 that you can calculate and see if there are any patterns you can use to solve the problem.
I need the first 12 digits and the last 12 digits. How would you solve this problem with code?