Primes which contain only one odd digit: Difference between revisions
Primes which contain only one odd digit (view source)
Revision as of 05:34, 29 July 2021
, 2 years ago→{{header|Julia}}
m (→{{header|Sidef}}: minor optimizations and simplifications) |
|||
Line 157:
println("Found $(length(found)) primes with one odd digit in base 10:")
foreach(p -> print(rpad(last(p), 5), first(p) % 9 == 0 ? "\n" : ""), enumerate(found))
println("\nThere are ", count(isoneoddprime, primes(1_000_000)),
" primes with only one odd digit in base 10 between 1 and 1,000,000."
</lang>{{out}}
<pre>
Line 165 ⟶ 168:
467 487 601 607 641 643 647 661 683
809 821 823 827 829 863 881 883 887
There are 2560 primes with only one odd digit in base 10 between 1 and 1,000,000.
</pre>
|