Problem 97

completed December 11, 2011

Comments

There was no way my computer would be able to calculate the actual number. Instead, I had it just calculate the last 14 digits of the number. I did this by defining a function timestwo to just return the last 14 digits of a number times 2. This way, the numbers I was working with always remained very manageable.

Code

def timestwo(x):
	return str(2 * int(x))[-14:]

a = 1
for i in range(7830457):
	print i
	a = timestwo(a)
	
print 28433 * int(a) + 1