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
getKMersenne :: Int -> Int -> [Integer] -> IO [Integer]
getKMersenne k n z = if genericLength z == n then return z else do
i <- primeMR 1 (2^p - 1)
if i then getKMersenne (k+1) n (z++[p]) else getKMersenne (k+1) n z
where p = primes !! (fromIntegral k)
Interesting to variate the first argument in primeMR.
I don't understand.
-- while using k=6 (exercise 6 shows that from k=6 and higher the check is not fooled by carmichael numbers),
-- it takes about 30 seconds. Both ks return the correct first 20 Mersenne primes.
-- The first 20 Mersenne primes can be discovered relatively quickly.
Not with primeMR 1 (2^p - 1)
6b (=6
7(=10)
7 (
The text was updated successfully, but these errors were encountered:
6a (=10)
Then you can variate
6b:
easier
Interesting to variate the first argument in
primeMR
.I don't understand.
Not with
primeMR 1 (2^p - 1)
6b (=6
7(=10)
7 (
The text was updated successfully, but these errors were encountered: