Created
July 21, 2012 19:43
-
-
Save vlad-shatskyi/3156936 to your computer and use it in GitHub Desktop.
Problem 63
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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