Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -- this implementation is pretty slow and brute-forcey
- let gcd a b | a > b = gcd b a | b == 0 = a | otherwise = gcd (a-b) b
- let lcm a b = div (a*b) (gcd a b)
- let fn x n | n < 20 = fn (lcm x (n+1)) | otherwise = x
- fn 1 2
Add Comment
Please, Sign In to add comment