All pastes #251681 Raw Edit

Mine

public python v1 · immutable
#251681 ·published 2006-11-18 13:42 UTC
rendered paste body
def gcd(a,b):     while b:         a, b = b, a % b     return a def totient(n):     if not (type(n)==type(1) and n>=0):         raise ValueError, 'Invalid input type'     tot,pos = 0, n     while pos>0:         if gcd(pos,n)==1: tot += 1         pos -= 1     return tot