[ create a new paste ] login | about

Link: http://codepad.org/dCBeMHjF    [ raw code | output | fork ]

Haskell, pasted on Apr 14:
1
2
3
4
5
isPerfect :: Int -> Bool
isPerfect n = 
  sum (
    filter (\x -> mod n x == 0) [1..(n-1)]) == n
main = print $ isPerfect 496


Output:
1
True


Create a new paste based on this one


Comments: