def squarePalGen(): for i, x in enumerate( squareCum ): for j, y in enumerate( squareCum ): if i <= j + 1: break elif isPal( str( x - y ) ): yield x - y
def largestPalindrome(): largestPal = 0; for i in range(100, 1000): for j in range(100, 1000): k = i * j if isPal(k) and k > largestPal: largestPal = k return largestPal
def f(): s = 0 for x in xrange(1,1000000): if isPal(str(x)) and isPal(bin(x)): s+=x return s
def pals(): for i in xrange( 999, 100, -1 ): for j in xrange( 999, 100, -1 ): if( isPal( str( i * j ) ) ): yield i * j
def isLychrel( n ): for i in xrange( 50 ): n = n + backwards( n ) if isPal( str( n ) ): return False return True