Anti-primes: Difference between revisions

Content added Content deleted
m (→‎{{header|REXX}}: changed a comment.)
m (→‎{{header|Perl 6}}: Typo, minor opt)
Line 259: Line 259:
my atomicint $last = 0;
my atomicint $last = 0;


my @anti-primes = lazy 1, |(|(2..59), 60, *+30 … *).hyper.grep: -> $c {
my @anti-primes = lazy 1, |(|(2..59), 60, *+60 … *).hyper.grep: -> $c {
my \mx = +propdiv($c);
my \mx = +propdiv($c);
next if mx <= $last;
next if mx <= $last;
Line 275: Line 275:
1 2 4 6 12 24 36 48 60 120 180 240 360 720 840 1260 1680 2520 5040 7560
1 2 4 6 12 24 36 48 60 120 180 240 360 720 840 1260 1680 2520 5040 7560


Count of anti-primes <= 500000: 36</pre>
Count of anti-primes <= 500000: 35</pre>


=={{header|Python}}==
=={{header|Python}}==