Primes whose sum of digits is 25: Difference between revisions

julia example
m (C++ output updated)
(julia example)
Line 558:
3967 4597 4759 4957
4993</pre>
 
=={{header|Julia}}==
<lang julia>using Primes
 
let
pmask, pcount = primesmask(1, 5000), 0
issum25prime(n) = pmask[n] && sum(digits(n)) == 25
 
println("Primes with digits summing to 25 between 0 and 5000:")
for n in 1:4999
if issum25prime(n)
pcount += 1
print(rpad(n, 5))
end
end
println("\nTotal found: $pcount")
end
</lang>{{out}}
<pre>
Primes with digits summing to 25 between 0 and 5000:
997 1699 1789 1879 1987 2689 2797 2887 3499 3697 3769 3877 3967 4597 4759 4957 4993
Total found: 17
</pre>
 
 
=={{header|Nanoquery}}==
4,102

edits