diff options
author | Joe Zhao <ztuowen@gmail.com> | 2015-04-01 10:49:49 +0800 |
---|---|---|
committer | Joe Zhao <ztuowen@gmail.com> | 2015-04-01 10:49:49 +0800 |
commit | 3eec84838808139470261893ce15846852384bcf (patch) | |
tree | 6c293d04f7c6f913da8fd06f215b7b6547de8105 /H34.hs | |
parent | a9abc1da41b56edbed00081800382e854d6698d0 (diff) | |
download | h99-3eec84838808139470261893ce15846852384bcf.tar.gz h99-3eec84838808139470261893ce15846852384bcf.tar.bz2 h99-3eec84838808139470261893ce15846852384bcf.zip |
+37 +38
Diffstat (limited to 'H34.hs')
-rw-r--r-- | H34.hs | 3 |
1 files changed, 2 insertions, 1 deletions
@@ -1,3 +1,4 @@ -- http://en.wikipedia.org/wiki/Euler%27s_totient_function -totient :: Integral a => a -> Bool + +totient :: (Integral a) => a -> Int totient x = length $ filter ((==1).(gcd x)) [1..x] |