Jump to content

Primes which contain only one odd digit: Difference between revisions

Added Easylang
m (→‎{{header|Wren}}: Minor tidy)
(Added Easylang)
Line 387:
Count < 1,000,000 = 2560
Elapsed Time: 171.630 ms.
</pre>
 
=={{header|EasyLang}}==
<syntaxhighlight>
fastfunc isprim num .
i = 2
while i <= sqrt num
if num mod i = 0
return 0
.
i += 1
.
return 1
.
fastfunc nextprim prim .
repeat
prim += 1
until isprim prim = 1
.
return prim
.
func digodd n .
while n > 0
r += if n mod 2 = 1
n = n div 10
.
return r
.
p = 2
repeat
p = nextprim p
if digodd p = 1
write p & " "
.
until p >= 1000
.
</syntaxhighlight>
{{out}}
<pre>
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
</pre>
 
2,063

edits

Cookies help us deliver our services. By using our services, you agree to our use of cookies.