Guest User

Untitled

a guest
Jan 21st, 2018
107
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.26 KB | None | 0 0
  1. primeFactors :: Int->[Int]
  2. primeFactors n
  3. | n `mod` divisor == 0 = primeFactors (n `div` divisor):divisor:[]
  4. | n == 2 = []
  5. | otherwise = n `mod` divisor `mod` (divisor+1)
  6. where divisor
  7. |primeFactors [] = 2
  8. |otherwise = divisor
Add Comment
Please, Sign In to add comment