View difference between Paste ID: U1BuR5qx and SvTHVCRR
SHOW: | | - or go back to the newest paste.
1-
factors :: Int -> [Int]
1+
2-
factors n = [x | x <- [1..n], n `mod` x == 0]
2+
3-
3+
4-
prime :: Int -> Bool
4+
5-
prime n = factors n == [1, n]
5+
6-
6+