summaryrefslogtreecommitdiff
path: root/H34.hs
blob: 6cbbdad8a9b4b28277907bba13b983aa778ec749 (plain)
1
2
3
4
-- http://en.wikipedia.org/wiki/Euler%27s_totient_function

totient :: (Integral a) => a -> Int
totient x = length $ filter ((==1).(gcd x)) [1..x]