summaryrefslogtreecommitdiff
path: root/H34.hs
diff options
context:
space:
mode:
authorJoe Zhao <ztuowen@gmail.com>2015-04-01 10:49:49 +0800
committerJoe Zhao <ztuowen@gmail.com>2015-04-01 10:49:49 +0800
commit3eec84838808139470261893ce15846852384bcf (patch)
tree6c293d04f7c6f913da8fd06f215b7b6547de8105 /H34.hs
parenta9abc1da41b56edbed00081800382e854d6698d0 (diff)
downloadh99-3eec84838808139470261893ce15846852384bcf.tar.gz
h99-3eec84838808139470261893ce15846852384bcf.tar.bz2
h99-3eec84838808139470261893ce15846852384bcf.zip
+37 +38
Diffstat (limited to 'H34.hs')
-rw-r--r--H34.hs3
1 files changed, 2 insertions, 1 deletions
diff --git a/H34.hs b/H34.hs
index 6db5e5d..6cbbdad 100644
--- a/H34.hs
+++ b/H34.hs
@@ -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]