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

From Rosetta Code
Content added Content deleted
(→‎The limit of primes that do not contain zeroes: Added a comment about C++ time.)
Line 6: Line 6:
:: <u>I'll be proper impressed if anyone ever manages a sub-10s</u> is reached.Generating the numbers for sum of digits = 25 is < 0.5 s.But on Win64 my old gmp.dll is very slow -> 7s => 15s [[User:Horsth|Horsth]] 13:06, 29 March 2021 (UTC)
:: <u>I'll be proper impressed if anyone ever manages a sub-10s</u> is reached.Generating the numbers for sum of digits = 25 is < 0.5 s.But on Win64 my old gmp.dll is very slow -> 7s => 15s [[User:Horsth|Horsth]] 13:06, 29 March 2021 (UTC)


:::On my machine, the C++ entry compiled with g++ is also coming in at 9.17 seconds so also (just) qualifies for 'proper impression' :) --[[User:PureFox|PureFox]] ([[User talk:PureFox|talk]]) 13:35, 29 March 2021 (UTC)
:::On my machine, the C++ entry compiled with g++ is coming in at 9.17 seconds so also (just) qualifies for 'proper impression' :) --[[User:PureFox|PureFox]] ([[User talk:PureFox|talk]]) 13:35, 29 March 2021 (UTC)


== Perhaps the syntax of the task title could be normalized ? ==
== Perhaps the syntax of the task title could be normalized ? ==

Revision as of 13:36, 29 March 2021

The limit of primes that do not contain zeroes


For what n? (0 < n < ?) --CalmoSoft (talk) 06:27, 21 March 2021 (UTC)

I think it is possible to put an upper limit on primes whose digits sum to 25 and have no zeroes in them. The largest number with no internal zeros and a digit sum of 25 would be 1111111111111111111111111 (25 digits). --Tigerofdarkness (talk) 10:54, 21 March 2021 (UTC)
Correct, stretch goal updated. If zeroes were allowed there would be an infinite number of them. It will need reasonably decent bignum handling and a fast prime number checker. I expect this is not really do-able in asm, etc. I would put a reasonable (soft) upper limit of say 30 mins runtime on this and not be too critical of anything around that, certainly not if it actually manages to get all the way to 1.5e6 in that timeframe, and I'll be proper impressed if anyone ever manages a sub-10s, on any box in any lang. The Phix algorithm generates 1.65e7 potential candidates (without testing for primality that takes just 7.7s) as opposed (it is rather daft to test even numbers for primality!) to +2 generating 5.55e24 candidates which at that same (test-less) rate would take around 8 billion years. --Pete Lomax (talk) 12:34, 21 March 2021 (UTC)
I'll be proper impressed if anyone ever manages a sub-10s is reached.Generating the numbers for sum of digits = 25 is < 0.5 s.But on Win64 my old gmp.dll is very slow -> 7s => 15s Horsth 13:06, 29 March 2021 (UTC)
On my machine, the C++ entry compiled with g++ is coming in at 9.17 seconds so also (just) qualifies for 'proper impression' :) --PureFox (talk) 13:35, 29 March 2021 (UTC)

Perhaps the syntax of the task title could be normalized ?

For example, something like "Primes with decimal digits summing to 25" ? Hout (talk) 11:18, 29 March 2021 (UTC)

Or just "Sum25 primes"? --Pete Lomax (talk) 12:25, 29 March 2021 (UTC)