Choose a random number $$n \in \mathbb{N}$$. Form a new number $$n'$$ by writing the digits of the number $$n$$ backwards. Calculate the sum $$n + n'$$ of these numbers.

hardnekkig

In most cases, repeating this procedure will eventually yield a palindrome:

hardnekkig hardnekkig

For some obscure reason, this doesn't apply to number 196 — at least, computer simulations that repeated the procedure until they got numbers of more than 300 million digits long, have never found a palindrome. Until this moment, nobody has found any sound proof for or against, so for now the answer to this question in unknown.

Assignment

A palindrome is a word, sentence or number or another sequence of characters that reads the same from left to right as from right to left. The term palindrome was introduced in the 17th century by the English author Ben Johnson1, and is a compound of the Greek words palin (πάλιν, "again") and dromos (δρóμος, "direction").

Example

>>> palindrome('a1b2c3c2b1a')
True
>>> palindrome('a1b2c3C2B1A')
False
>>> palindrome('a1b2c3C2B1A', uppercasesensitive=False)
True
>>> palindrome('a1b2c3c4b5a')
False
>>> palindrome('a1b2c3c4b5a', digits=False)
True

>>> palindrome('step on no pets')
True
>>> palindrome('Step on no pets')
False
>>> palindrome('Step on no pets', uppercasesensitive=False)
True
>>> palindrome("No 'x' in 'Nixon'", other=False, uppercasesensitive=False)
True

>>> stubborn(871)
3
>>> stubborn(196)
1000
>>> stubborn(196, maximum=200)
200
>>> stubborn(78552)
31
>>> stubborn(78552, maximum=25)
25