Exemple #1
0
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
Exemple #2
0
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
Exemple #3
0
def f():
  s = 0
  for x in xrange(1,1000000):
    if isPal(str(x)) and isPal(bin(x)): s+=x
  return s
Exemple #4
0
def pals():
    for i in xrange( 999, 100, -1 ):
        for j in xrange( 999, 100, -1 ):
            if( isPal( str( i * j ) ) ):
                yield i * j
Exemple #5
0
def isLychrel( n ):
    for i in xrange( 50 ):
        n = n + backwards( n )
        if isPal( str( n ) ):
            return False
    return True