diff --git a/src/3n+1/Main.hs b/src/3n+1/Main.hs index fa64876..2e22911 100644 --- a/src/3n+1/Main.hs +++ b/src/3n+1/Main.hs @@ -3,11 +3,17 @@ The Simplest Math Problem No One Can Solve - Collatz Conjecture https://youtu.be/094y1Z2wpJg -} -import Control.Monad () -import Debug.Trace (trace) +import Control.Parallel.Strategies +import Data.Set (fromList) +import Debug.Trace (trace) main :: IO () -main = print $ take 100 $ map f [2^1000..] +main = print $ fromList $ take 300 $ parMap rpar f [2^100_000..] +-- main = print $ fromList $ take 300 $ map f [2^100_000..] + -- fromList [100001,717859] + +-- main = print $ fromList $ take 3 $ map f [2^310997..] +-- main = print $ f $ 2^310997 + 2 f :: Integer -> Integer f n = s 1 n