Finished existing ipython solutions to python. Ready to continue in pure python.
This commit is contained in:
@@ -1,8 +1,22 @@
|
||||
from lib_misc import get_digit_count
|
||||
|
||||
|
||||
def get_n_digit_positive_integers(n):
|
||||
r = []
|
||||
i = 1
|
||||
while True:
|
||||
if get_digit_count(i ** n) == n:
|
||||
r.append(i ** n)
|
||||
if get_digit_count(i ** n) > n:
|
||||
return r
|
||||
i += 1
|
||||
|
||||
|
||||
def euler_063():
|
||||
return 0
|
||||
s = sum([len(get_n_digit_positive_integers(n)) for n in range(1, 1000)])
|
||||
return s
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
print("e063.py: " + str(euler_063()))
|
||||
assert(euler_063() == 0)
|
||||
assert(euler_063() == 49)
|
||||
|
||||
Reference in New Issue
Block a user