Exemplo n.º 1
0
def isLeftTruncatable(n):
    
    text = str(n)
    for i in range(1,len(text)):
        
        text = text[1:]
        if not isPrimeFactors(int(text)):
            return False

    return True
Exemplo n.º 2
0
def generateRightTruncatables(n):

    list1 =     [2,3,5,7]
    list2 =     []
    ret_list =  []

    if n == 1:
        return list1

    for i in range(1,n):
        for l in list1:
            for d in [1,3,7,9]:
                candidate = 10*l + d
                if isPrimeFactors(candidate):
                    list2.append(candidate)
                    ret_list.append(candidate)
        list1 = list2
        list2 = []

    return ret_list