User talk:PureFox: Difference between revisions

Line 220:
 
:No problem, Gerard, just a minor alteration was needed. Incidentally, I'm glad this task came up as it reminded me that I needed to add an integer square root method to my Wren BigInt class. This algorithm looks ideal as it's non-recursive, uses only integer arithmetic and is reasonably fast so I'm going to look at adding that today. Thanks. --[[User:PureFox|PureFox]] ([[User talk:PureFox|talk]]) 14:19, 16 July 2020 (UTC)
 
== Primes which sum of digits is 25 ==
 
Just a small comment, to figure out, how slow an AMD 2200G is.
Your go version takes <pre> go version go1.16.2 linux/amd64 (installed today)
There are 1,525,142 primes whose digits sum to 25 and include no zeros.
 
Took 31.330058446s
 
only counting
if rem == 0 {
res++
/*
b := p[len(p)-1]
if b == '1' || b == '3' || b == '7' || b == '9' {
z := new(big.Int)
z.SetString(p, 10)
if z.ProbablyPrime(1) {
res++
}
}*/
} else {
There are 16,499,120 primes whose digits sum to 25 and include no zeros.
 
Took 4.980341373s</pre>
I couldn't compile the cpp version.<BR>I only wanted to know, if generating the possible combinations = 1291 and than create the permutations could be faster for generating the numbers. [[user:horsth|Horsth]] 17:55, 29 March 2021 (UTC)
Anonymous user