24 lines
465 B
Python
24 lines
465 B
Python
|
|
def get_palindrome(num):
|
|
return int(str(num)[::-1])
|
|
|
|
|
|
def is_palindrome(num):
|
|
return get_palindrome(num) == num
|
|
|
|
|
|
if __name__ == '__main__':
|
|
|
|
results = []
|
|
for i in range(10, 10000):
|
|
num = i + get_palindrome(i)
|
|
counter = 0
|
|
while counter < 50 and not is_palindrome(num):
|
|
num += get_palindrome(num)
|
|
counter += 1
|
|
if not is_palindrome(num):
|
|
results.append(i)
|
|
print(len(results))
|
|
|
|
|