mersenneforum.org Using gfndsieve
 Register FAQ Search Today's Posts Mark Forums Read

 2019-01-28, 09:10 #1 houding     "Adolf" Nov 2013 South Africa 6110 Posts Using gfndsieve I've started to look into using gfndsieve, because it is multi-threaded. I have a question. Not a problem with the program, just curious. When I start a sieve, it will say "expecting 192048 factors". I will run a bit. Then stop. It will say 190376 factors found. 9624 left. So the expecting is less than the actual. How is the expecting calculated? Or is it just a guess that for a given amount of numbers in a range so many could be factors after others have been eliminated because they are even numbers?
2019-01-28, 12:37   #2
ET_
Banned

"Luigi"
Aug 2002
Team Italia

2×2,383 Posts

Quote:
 Originally Posted by houding I've started to look into using gfndsieve, because it is multi-threaded. I have a question. Not a problem with the program, just curious. When I start a sieve, it will say "expecting 192048 factors". [...] How is the expecting calculated? Or is it just a guess that for a given amount of numbers in a range so many could be factors after others have been eliminated because they are even numbers?
If you dive into the source code, you will find a formula that calculates the approximate numbers of possible factors in a range.

At line 212 of FactorApp.cpp you will find:

Code:

if (il_MaxPrime != il_AppMaxPrime)
{
double expectedFactors = il_TermCount * (1 - log(il_MinPrime) / log (il_MaxPrime));

sprintf(endOfMessage, "expecting %.f factors", expectedFactors);
}