Safe primes and unsafe primes: Difference between revisions

m
Fix Perl 6 -> Raku in comments
(Rename Perl 6 -> Raku, alphabetize, minor clean-up)
m (Fix Perl 6 -> Raku in comments)
Line 495:
 
=={{header|Factor}}==
Much like the Perl 6Raku example, this program uses an in-built primes generator to efficiently obtain the first ten million primes. If memory is a concern, it wouldn't be unreasonable to perform primality tests on the (odd) numbers below ten million, however.
<lang factor>USING: fry interpolate kernel literals math math.primes
sequences tools.memory.private ;
Line 1,325:
(formerly Perl 6)
{{works with|Rakudo|2018.08}}
Perl&nbsp;6Raku has a built-in method .is-prime to test for prime numbers. It's great for testing individual numbers or to find/filter a few thousand numbers, but when you are looking for millions, it becomes a drag. No fear, the Perl&nbsp;6Raku ecosystem has a fast prime sieve module available which can produce 10 million primes in a few seconds. Once we have the primes, it is just a small matter of filtering and formatting them appropriately.
 
<lang perl6>sub comma { $^i.flip.comb(3).join(',').flip }
10,333

edits