Jump to content

Primes with digits in nondecreasing order: Difference between revisions

Added Easylang
m (→‎{{header|Wren}}: Changed to Wren S/H)
(Added Easylang)
 
Line 608:
</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 digok n .
d = 9
while n > 0
dp = d
d = n mod 10
if dp < d
return 0
.
n = n div 10
.
return 1
.
p = 2
repeat
if digok p = 1
write p & " "
.
p = nextprim p
until p >= 1000
.
 
</syntaxhighlight>
{{out}}
<pre>
2 3 5 7 11 13 17 19 23 29 37 47 59 67 79 89 113 127 137 139 149 157 167 179 199 223 227 229 233 239 257 269 277 337 347 349 359 367 379 389 449 457 467 479 499 557 569 577 599 677
</pre>
 
=={{header|F_Sharp|F#}}==
Line 620 ⟶ 666:
2 3 5 7 11 13 17 19 23 29 37 47 59 67 79 89 113 127 137 139 149 157 167 179 199 223 227 229 233 239 257 269 277 337 347 349 359 367 379 389 449 457 467 479 499 557 569 577 599 677
</pre>
 
=={{header|Factor}}==
{{works with|Factor|0.99 2021-02-05}}
2,063

edits

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