Primes whose sum of digits is 25: Difference between revisions

Add Tcl
(Add Tcl)
Line 1,689:
done...
</pre>
 
=={{header|Tcl}}==
{{tcllib|math::numtheory}}
Could be made prettier with the staple helper proc lfilter.
<lang tcl>package require Tcl 8.5
package require math::numtheory
namespace path ::tcl::mathop
 
puts [lmap x [math::numtheory::primesLowerThan 5000] {
if {[+ {*}[split $x {}]] == 25} {set x} else continue
}]</lang>
 
{{out}}
<pre>997 1699 1789 1879 1987 2689 2797 2887 3499 3697 3769 3877 3967 4597 4759 4957 4993</pre>
 
=={{header|Wren}}==
Anonymous user