Skip to content

Instantly share code, notes, and snippets.

@vlad-shatskyi
Created July 21, 2012 19:43
Show Gist options
  • Save vlad-shatskyi/3156936 to your computer and use it in GitHub Desktop.
Save vlad-shatskyi/3156936 to your computer and use it in GitHub Desktop.
Problem 63
total = 0
next_order = 10
length = 1
while True:
result_of_power = 0
base = 1
list_of_powers = []
while result_of_power < next_order:
result_of_power = base**length
list_of_powers.append(result_of_power)
base += 1
for x in list_of_powers:
if len(str(x))==length:
total +=1
print total
print x
next_order *= 10
length += 1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment