Ejemplo n.º 1
0
def getAnswer(n):
    for num in getTriangleNums():
        cards = factorCardByPrime(num)
        divs = 1
        for card in cards:
            divs *= (cards[card]+1)
        if divs > n:
            return num
Ejemplo n.º 2
0
def getAnswer(n):
    cards = {}
    for i in range(2,n+1):
        c = factorCardByPrime(i)
        for prime in c:
            if prime not in cards or c[prime]>cards[prime]:
                cards[prime]=c[prime]

    p=1
    for i in cards:
        p *= i**cards[i]
    return p
Ejemplo n.º 3
0
def d(n):
    s=0
    primeCards = factorCardByPrime(n)
    primes = list(primeCards)
    cards = tuple([primeCards[prime] for prime in primes])
    for divCard in tupleRange(cards):
        div=1
        for i in range(len(divCard)):
            div *= primes[i]**divCard[i]
        if div!=n:
            s += div
    return s
Ejemplo n.º 4
0
def getAnswer(n):
    cards = factorCardByPrime(n)
    return sorted(list(cards))[-1]