Beispiel #1
0
def p073(N=12000):
    retval = 0
    for d in range(2,N+1):
        total = p069.phi(d)
        lowerthird = len([n for n in range(d/3+1) if numty.gcd(n,d) == 1])
        retval += total/2-lowerthird
    return retval
Beispiel #2
0
def p072(N=10**6):
    table = numty.factortable(N + 1)
    return sum(p069.phi(n, table[n]) for n in range(2, N + 1))
Beispiel #3
0
def p072(N=10**6):
    table = numty.factortable(N+1)
    return sum(p069.phi(n, table[n]) for n in range(2,N+1))