blob: 127dc62a489397ffef4aa51de006a430dbbfd80c (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
|
-- Haskell
import Prelude hiding (gcd)
gcd :: Integer -> Integer -> Integer
gcd a b = if b > 0 then gcd b (mod a b) else a
main = do
putStrLn "test"
let n = 1000
let a = [0..n-1]
print $ sum (map (\i -> sum (map (`gcd` i) a)) a)
|