Successive prime differences: Difference between revisions

Content added Content deleted
Line 633: Line 633:


===Dynamic computed input===
===Dynamic computed input===
<lang haskell>import Data.Numbers.Primes (primes)
<lang haskell>{-# LANGUAGE NumericUnderscores #-}
import Data.Numbers.Primes (primes)


-- Type alias dictionary. Key is the difference group and value is a successive prime group.
-- Type alias dictionary. Key is the difference group and value is a successive prime group.
Line 659: Line 660:
main = mapM_ (showGroup result . show) diffs
main = mapM_ (showGroup result . show) diffs
where (diffs, result) = groups [[2], [1], [2,2], [2,4], [4,2], [6,4,2]]
where (diffs, result) = groups [[2], [1], [2,2], [2,4], [4,2], [6,4,2]]
groups diffs = (diffs, findPrimes (takeWhile (<1000000) primes) diffs)</lang>
groups diffs = (diffs, findPrimes (takeWhile (<1_000_000) primes) diffs)</lang>
{{out}}
{{out}}
<pre>
<pre>