Ramanujan primes/twins: Difference between revisions

m
→‎{{header|Raku}}: Avoid calculating excess Ramanujan primes before filering
(→‎{{header|Raku}}: Add a Raku example)
m (→‎{{header|Raku}}: Avoid calculating excess Ramanujan primes before filering)
Line 338:
=={{header|Raku}}==
Timing is informational only. Will vary by system specs and load.
<lang perl6>use ntheory:from<Perl5> <ramanujan_primes nth_ramanujan_prime>;
use Lingua::EN::Numbers;
 
my @rp = ramanujan_primes(100_000_000)[^ nth_ramanujan_prime 1_000_000];
 
for (1e5, 1e6)».Int -> $limit {
Line 355:
The 1,000,000th Ramanujan prime is 34,072,993
There are 74,973 twins in the first 1,000,000 Ramanujan primes.
2.863529 seconds</pre>
 
=={{header|Wren}}==
10,327

edits