Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- primeFactors :: Int->[Int]
- primeFactors n
- | n `mod` divisor == 0 = primeFactors (n `div` divisor):divisor:[]
- | n == 2 = []
- | otherwise = n `mod` divisor `mod` (divisor+1)
- where divisor
- |primeFactors [] = 2
- |otherwise = divisor
Add Comment
Please, Sign In to add comment