Primes which contain only one odd digit: Difference between revisions

→‎{{header|jq}}: fix markdown
(→‎{{header|jq}}: fix markdown)
Line 395:
emit_until(. > 1000; primes_with_exactly_one_odd_digit),
 
"\nThe number of primes less than 1000000 with exactly one odd digits is \(count(emit_until(. > 1000000; primes_with_exactly_one_odd_digit)))."</lang>
{{out}}
<pre>
Line 446:
The number of primes less than 1000000 with exactly one odd digits is 2560.
</pre>
=== A simpler but slower solution ===
<lang jq># Input is assumed to be prime.
# So we only need check the other digits are all even.
2,458

edits