def lychrel( n, limit=50 ): """ >>> from euler55 import lychrel >>> lychrel(10677) True >>> lychrel(10677,limit=53) False >>> lychrel(4994) True """ n= reverseAndAdd( n ) for count in range(limit): if palindrome(n): return False n= reverseAndAdd( n ) return True
def pal_2_10(): for n in range(1000000): if palindrome( n, 2 ) and palindrome( n, 10 ): yield n