Ramanujan primes/twins: Difference between revisions
Content added Content deleted
SqrtNegInf (talk | contribs) (Added Perl) |
|||
Line 163: | Line 163: | ||
0.759511 seconds (50 allocations: 839.383 MiB, 5.64% gc time) |
0.759511 seconds (50 allocations: 839.383 MiB, 5.64% gc time) |
||
</pre> |
</pre> |
||
=={{header|Mathematica}}/{{header|Wolfram Language}}== |
|||
<lang Mathematica>$HistoryLength = 1; |
|||
l = PrimePi[Range[35 10^6]] - PrimePi[Range[35 10^6]/2]; |
|||
ramanujanprimes = GatherBy[Transpose[{Range[2, Length[l] + 1], l}], Last][[All, -1, 1]]; |
|||
ramanujanprimes = Take[Sort@ramanujanprimes, 10^6]; |
|||
Count[Differences[ramanujanprimes], 2]</lang> |
|||
{{out}} |
|||
<pre>74973</pre> |
|||
=={{header|Nim}}== |
=={{header|Nim}}== |