Exemplo n.º 1
0
def totient_perms(limit):
    for num in xrange(2, limit):
        totient_val = totient(num)
        if sorted(str(num)) == sorted(str(totient_val)):
            yield num, totient_val
Exemplo n.º 2
0
def is_totient_perm(num):
    return sorted(str(num)) == sorted(str(totient(num)))
Exemplo n.º 3
0
def using_totient():
    """First attempt - summing the Euler totient of each number ≤ 1,000,000"""
    s = 0
    for n in xrange(LIMIT, 1, -1):
        s += totient(n)
    return s