def reversed_string(a_string):
return a_string[::-1]
def lychrel(n):
s = str(n)
if s == reversed_string(s):
print(s + ' é palíndromo!')
return n
m = int(reversed_string(s))
c = m + n
print(s + ' + ' + str(m) + ' = ' + str(c))
return lychrel(c)
lychrel(468)
ZGVmIHJldmVyc2VkX3N0cmluZyhhX3N0cmluZyk6CiAgICByZXR1cm4gYV9zdHJpbmdbOjotMV0KCmRlZiBseWNocmVsKG4pOgogICAgcyA9IHN0cihuKQogICAgaWYgcyA9PSByZXZlcnNlZF9zdHJpbmcocyk6CiAgICAgICAgcHJpbnQocyArICcgw6kgcGFsw61uZHJvbW8hJykKICAgICAgICByZXR1cm4gbgogICAgbSA9IGludChyZXZlcnNlZF9zdHJpbmcocykpCiAgICBjID0gbSArIG4KICAgIHByaW50KHMgKyAnICsgJyArIHN0cihtKSArICcgPSAnICsgc3RyKGMpKQogICAgcmV0dXJuIGx5Y2hyZWwoYykKCmx5Y2hyZWwoNDY4KQ==