Initial commit
This commit is contained in:
13
problem-36.py
Normal file
13
problem-36.py
Normal file
@@ -0,0 +1,13 @@
|
||||
|
||||
MAX_NUM = 1000000
|
||||
|
||||
if __name__ == '__main__':
|
||||
results = []
|
||||
for i in range(MAX_NUM):
|
||||
rev = int(str(i)[::-1])
|
||||
binary_i = bin(i)[2:]
|
||||
rev_binary_i = binary_i[::-1]
|
||||
if i == rev and binary_i == rev_binary_i:
|
||||
results.append(i)
|
||||
print(results)
|
||||
print(sum(results))
|
||||
Reference in New Issue
Block a user