Talk:Primes whose sum of digits is 25: Difference between revisions

m
 
(3 intermediate revisions by 2 users not shown)
Line 15:
 
::Using a certainty level of 3, both the Go and C++ examples still give the same answer (1,525,141 primes) though, surprisingly, the difference in timings was negligible. --[[User:PureFox|PureFox]] ([[User talk:PureFox|talk]]) 18:49, 29 March 2021 (UTC)
:::testing the false checked primes.<br><Lang pascal>procedure OUT_FalsePrime(n:NativeINt);
Begin
writeln('false checked ',CS,' after ',n,' rounds');
end;
procedure CheckPrime;
begin
mpz_set_str(z,CS,10);
// if mpz_probab_prime_p(z,0)>0 then inc(PrimeCount);
if mpz_probab_prime_p(z,0)>0 then
if mpz_probab_prime_p(z,1)= 0 then
OUT_FalsePrime(1)
else
if mpz_probab_prime_p(z,2)= 0 then
OUT_FalsePrime(2)
else
if mpz_probab_prime_p(z,3)= 0 then
OUT_FalsePrime(3)
else
if mpz_probab_prime_p(z,5)= 0 then
OUT_FalsePrime(5)
else
inc(PrimeCount)
end;</lang>
{{out}}
<pre>GMP-Version 6.1.2
false checked 2194111141 after 1 rounds
false checked 128124151 after 1 rounds
false checked 1134342151 after 1 rounds
false checked 11973121 after 1 rounds
false checked 12941161 after 1 rounds
false checked 15614161 after 1 rounds
false checked 132641521 after 1 rounds
false checked 26157121 after 1 rounds
false checked 41581321 after 1 rounds
false checked 12731461 after 1 rounds
false checked 1281661 after 1 rounds
false checked 4411681 after 1 rounds
false checked 1432242241 after 1 rounds
false checked 237224311 after 1 rounds
false checked 25292131 after 1 rounds
false checked 12225841 after 1 rounds
false checked 31294231 after 1 rounds
false checked 18342241 after 1 rounds
false checked 1722913 after 1 rounds
false checked 14555221 after 1 rounds
false checked 34124641 after 1 rounds
false checked 1943521 after 3 rounds <========== astonishing small number
false checked 1235851 after 1 rounds
false checked 1132657 after 1 rounds
false checked 64343311 after 1 rounds
false checked 1584133 after 1 rounds
false checked 1357441 after 1 rounds
false checked 5354611 after 1 rounds
false checked 28213333 after 1 rounds
false checked 4922413 after 1 rounds
false checked 3255271 after 1 rounds
false checked 1372453 after 1 rounds
false checked 5423713 after 1 rounds
false checked 3542533 after 1 rounds
PrimeCount of generated numbers with digits sum of 25 are 16499120
Propably primes 1525141</pre>
TIO.RUN uses GMP-Version 6.1.2 too, with same results.<BR>[[User:Horsth|Horsth]] 18:31, 30 March 2021 (UTC)
::::Intalled GMP 6.2.1 and now a certainty level of 0 "if mpz_probab_prime_p(z,0)>0 then .." suffices to find 1525141 Propably primes <BR>The runtime is lifted to 11.2 s :-( ;-)<BR>[[User:Horsth|Horsth]] 05:52, 31 March 2021 (UTC)
 
== Perhaps the syntax of the task title could be normalized ? ==
For example, something like "''Primes with decimal digits summing to 25''" ? [[User:Hout|Hout]] ([[User talk:Hout|talk]]) 11:18, 29 March 2021 (UTC)
 
:Or just "Sum25 primes"? --[[User:Petelomax|Pete Lomax]] ([[User talk:Petelomax|talk]]) 12:25, 29 March 2021 (UTC)
 
:: Or &nbsp; ''Two-bit primes''? &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; For right-ponders and elsewhere, that's slang for &nbsp; <big>25¢,</big> &nbsp; or a quarter of a (US) dollar. &nbsp; &nbsp; -- [[User:Gerard Schildberger|Gerard Schildberger]] ([[User talk:Gerard Schildberger|talk]]) 13:23, 24 April 2021 (UTC)
2,442

edits