Jump to content

Primes whose sum of digits is 25: Difference between revisions

Added Easylang
m (→‎{{header|Wren}}: Minor tidy)
(Added Easylang)
Line 802:
3769 3877 3967 4597 4759
4957 4993</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 .
while n > 0
dsum += n mod 10
n = n div 10
.
return if dsum = 25
.
p = 2
repeat
p = nextprim p
if digok p = 1
write p & " "
.
until p >= 5000
.
</syntaxhighlight>
{{out}}
<pre>
997 1699 1789 1879 1987 2689 2797 2887 3499 3697 3769 3877 3967 4597 4759 4957 4993
</pre>
 
=={{header|F_Sharp|F#}}==
Line 813 ⟶ 853:
997 1699 1789 1879 1987 2689 2797 2887 3499 3697 3769 3877 3967 4597 4759 4957 4993
</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.