1
0
Fork 0

Problem 72

This commit is contained in:
Jonathan Chan 2017-07-03 10:51:27 -07:00
parent 33a0bdc69f
commit 9efc3acd17
4 changed files with 6 additions and 0 deletions

BIN
72 Executable file

Binary file not shown.

BIN
72.hi Normal file

Binary file not shown.

6
72.hs Normal file
View File

@ -0,0 +1,6 @@
import Math.NumberTheory.Primes.Factorisation
totient :: Integer -> Integer
totient n = foldr (\(p, _) acc -> acc * (p-1) `div` p) n $ factorise n
main = print $ sum $ map totient [2..1000000]

BIN
72.o Normal file

Binary file not shown.