Primes whose sum of digits is 25: Difference between revisions
Add Factor
SqrtNegInf (talk | contribs) (Added Perl) |
(Add Factor) |
||
Line 108:
3769 3877 3967 4597 4759
4957 4993</pre>
=={{header|Factor}}==
{{works with|Factor|0.99 2021-02-05}}
<lang factor>USING: kernel lists lists.lazy math math.primes.lists prettyprint ;
: digit-sum ( n -- sum )
0 swap [ 10 /mod rot + swap ] until-zero ;
: lprimes25 ( -- list ) lprimes [ digit-sum 25 = ] lfilter ;
lprimes25 [ 5,000 < ] lwhile [ . ] leach</lang>
{{out}}
<pre style="height:14em">
997
1699
1789
1879
1987
2689
2797
2887
3499
3697
3769
3877
3967
4597
4759
4957
4993
</pre>
=={{header|Go}}==
|