Project Euler Problem 21
http://projecteuler.net/index.php?section=problems&id=21
10000未満の友愛数の合計
数学的にうまい方法はあるんだろうけど、定義のまんまごり押しで
main = print $ sum $ filter isAmicable [1..10000] isAmicable :: Int -> Bool isAmicable n = let d = sum $ properDivisors n in if (sum $ properDivisors d) == n && n /= d then True else False properDivisors :: Int -> [Int] properDivisors n = filter (\x -> (n `mod` x) == 0) [1..n-1]