Re: A Fun Recursive Prime Count Estimator



<gjedwards@xxxxxxxxx>

(in plain text I don't know how you write that big pi-like symbol
That's an upper-case pi, which I guess comes from the word "product" in some
language or other.

In case I screwed this up here's the algorithm in C (returns

'probability' that N is prime):

double EstimatedPrimeProb(
double N
)
{
int i;
double prob = 1;

double rootN = sqrt(N);
if(N<=2)
return 1;
else
{
for(i=2; i<=rootN; i++)
{
prob = prob*( 1 - (EstimatedPrimeProb(i)/i ) );
}
return prob;
}
}

Looks reasonable to me. Funky identities in number theory are sometimes
intelligible in terms of probability.


.