Primes which contain only one odd digit: Difference between revisions

m (→‎{{header|ALGOL 68}}: trivial formatting change)
Line 218:
 
Found 2560 primes with only one odd digit below 1_000_000.</pre>
 
=={{header|Perl}}==
<lang perl>#!/usr/bin/perl
 
use strict;
use warnings;
use ntheory qw( primes );
 
my @singleodd = grep tr/13579// == 1, @{ primes(1e3) };
my $million = grep tr/13579// == 1, @{ primes(1e6) };
print "found " . @singleodd .
"\n\n@singleodd\n\nfound $million in 1000000\n" =~ s/.{60}\K /\n/gr;</lang>
{{out}}
<pre>
found 45
 
3 5 7 23 29 41 43 47 61 67 83 89 223 227 229 241 263 269 281
283 401 409 421 443 449 461 463 467 487 601 607 641 643 647 661
683 809 821 823 827 829 863 881 883 887
 
found 2560 in 1000000
</pre>
 
=={{header|Raku}}==
Anonymous user