Anonymous user
Primes whose sum of digits is 25: Difference between revisions
m
→{{header|C++}}: small modification certenty level 25-> 3 TIO.tun runtime
(→{{header|Pascal}}: reduced count of generated numbers for testing,move 1,3,7,9 and permute digits in front) |
m (→{{header|C++}}: small modification certenty level 25-> 3 TIO.tun runtime) |
||
Line 435:
bool is_probably_prime(const mpz_class& n) {
return mpz_probab_prime_p(n.get_mpz_t(),
}
Line 508:
{{out}}
<pre>
//https://tio.run/#cpp-gcc -lgmp -O3
Primes < 5,000 whose digits sum to 25:
997 1,699 1,789 1,879 1,987 2,689 2,797 2,887 3,499 3,697
Line 513 ⟶ 514:
There are 1,525,141 primes whose digits sum to 25 and include no zeros.
Time taken:
.....
Real time: 11.214 s
User time: 11.075 s
Sys. time: 0.082 s
CPU share: 99.50 %
Exit code: 0
</pre>
|