You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
--alternative solution with monads, can not work with infinite lists
--generates a list of potential mersenne primes for given list
--uses miller rabin test to classify primality
mrMersennePrimeGenerator :: [Integer] -> IO [Integer]
mrMersennePrimeGenerator [] = return []
mrMersennePrimeGenerator (x:xs) = do
result <- mrMersenneTest x 1
recurse <- mrMersennePrimeGenerator xs
if result then return (x : recurse )
else return recurse
The text was updated successfully, but these errors were encountered:
No comment. Perfect.
Interesting remark:
The text was updated successfully, but these errors were encountered: