Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Lab 6: 6a, 6b, 7 #9

Open
BertLisser opened this issue Oct 18, 2017 · 0 comments
Open

Lab 6: 6a, 6b, 7 #9

BertLisser opened this issue Oct 18, 2017 · 0 comments

Comments

@BertLisser
Copy link

6a (<-10)

6b

printMer::Integer -> IO Integer
printMer x = do  
    b <- primeMR 10 ((2^x)-1)
    if b then putStrLn $ (show x) ++ " = (2^" ++ (show x) ++ "-1)" else putStr ""
    return (if b then 1 else 0)

test_mersprimes::[Integer] -> IO String
test_mersprimes ts =  return ("total " ++) <*> (return show <*> (mp ts))
    where 
        mp = foldr (\x b -> pure (+) <*> (printMer x) <*> b) (return (0)) 

I expected to see results with a varying first argument of primeMR. If this is chosen equal to 1 then you see that even primeMR generates false positives at Mesienne Primes.

6b(<-8)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant