Chowla numbers: Difference between revisions
Content deleted Content added
m changed the appearance of an apparent unary (negative) operator. |
|||
Line 1,578: | Line 1,578: | ||
printf "There are %2d perfect numbers < 35,000,000\n" $ length perfects |
printf "There are %2d perfect numbers < 35,000,000\n" $ length perfects |
||
where |
where |
||
chowlaP = fmap (bimap commas commas) |
chowlaP = fmap (bimap commas commas) . snd |
||
. snd |
|||
. mapAccumL (\total (count, max) -> (total + count, (total + count, max))) 0 |
. mapAccumL (\total (count, max) -> (total + count, (total + count, max))) 0 |
||
. fmap (chowlaPrimes allChowlas) |
. fmap (chowlaPrimes $ take (10^7) allChowlas) |
||
perfects = chowlaPerfects allChowlas |
perfects = chowlaPerfects allChowlas |
||
allChowlas = chowlas [1..35 |
allChowlas = chowlas [1..35*10^6]</lang> |
||
{{out}} |
{{out}} |
||
<pre>Using 4 cores |
<pre>Using 4 cores |