Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- primzahlen = sieb [2..]
- where sieb (p:xs) = p : sieb [n | n <- xs, n `mod` p > 0]
- fact n (p:ys) | p*p > n = [n]
- | n `mod` p == 0 = p : fact (n `div` p) (p:ys)
- | otherwise = fact n ys
- primfaktor 1 = []
- primfaktor n = fact n primzahlen
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement