Sieve of Eratosthenes: Difference between revisions
→Tree-merging incremental sieve: no primed names please -- the highlighting is horrendous with those
Not a robot (talk | contribs) (Add Draco) |
(→Tree-merging incremental sieve: no primed names please -- the highlighting is horrendous with those) |
||
Line 8,661:
_U ((x:xs):t) = x : (merge xs . _U . pairs) t -- tree-shaped folding big union
pairs (xs:ys:t) = merge xs ys : pairs t
merge xs@(x:
Works with odds only, the simplest kind of wheel. Here's the [http://ideone.com/qpnqe test entry] on Ideone.com, and a [http://ideone.com/p0e81 comparison with more versions].
|