Ramanujan primes: Difference between revisions
m
→Pure Raku: Revert to slower pure Raku version
Thundergnat (talk | contribs) (→Raku ntheory library: twiddles) |
Thundergnat (talk | contribs) m (→Pure Raku: Revert to slower pure Raku version) |
||
Line 559:
All timings are purely informational. Will vary by system specs and load.
=== Pure Raku ===
<lang perl6>use
use Lingua::EN::Numbers;
my $primes = Math::Primesieve.new;
my @mem;
sub
1 + (1..(4×n × (4×n).log / 2.log).floor).first: :end, -> \x {
my \y = x div 2;
}
}
say 'First 100:';
say
say "\n 1,000th: { comma
say "10,000th: { comma
say (now - INIT now).fmt('%.3f') ~ ' seconds';</lang>
{{out}}
<pre>First 100:
2 11 17 29 41 47 59 67 71 97
101 107
233 239 241 263 269 281
367 373 401 409 419 431 433 439 461 487
491 503
643 647 653 659 677
809 821 823 827 853 857 881
967 983
1,087 1,091 1,097 1,103 1,
1,277 1,289 1,297 1,301 1,
1,000th: 19,403
10,000th:
=== ntheory library ===
|