Reputation: 1
from decimal import Decimal
a = Decimal()
a = 2
for i in range(1, 64):
a = a*a
print(a)
Upvotes: 0
Views: 62
Reputation: 2346
Well, looking at the question in the image, what you're actually looking to do is sum the values, not just get the largest one.
Since:
2^0 + 2^1 + ... + 2^n = 1 + 2 + ... + 2^n = 2^(n+1) - 1
all the code you really need is:
print(pow(a,64) - 1)
Upvotes: 1