Example #1
0
def ec_phi(n, d):
    if is_prime(n):
        return n-1

    if not n % d:
        if is_prime(d):
            q = n / d
            return (d-1)*ec_phi(q, int(q**.5) + 1)

    return ec_phi(n, d-1)
Example #2
0
def is_strong(n):
    d = digit_sum(n)
    if is_prime(n/d):
        return True
    return False