Author | Message |
---|---|
rabbott
Posts: 1649
|
Posted 17:02 Aug 27, 2016 |
Instead of searching for primes p you could search for constants k. oddsFrom3 = [3, 5 .. ] primeDivisors n = [d | d <- takeWhile ((<= n) . (^2)) primes, n `mod` d == 0] primes = 2 : [p | p <- oddsFrom3, null (primeDivisors p)] -- Michael Fong suggested using dropWhile for isPrime. -- In the following we are looking for a k such that g - 2 * k * k is prime. We limit the search -- Or search for primes as before. goldbachFails' = [g | g <- takeWhile (< 6000) oddsFrom3, not (isPrime g), Last edited by rabbott at
12:48 Aug 28, 2016.
|