Roger Hui wrote:

> The MathWorld page doesn't give the derivation

I believe the MathWorld formula is the same as the J derivation.

Primes are indexed starting at 1. You iterate over primes p_k whose
square is less than or equal to n.  The term pi(n/p_k) counts primes q
such that n>:(p_k)*q . You subtract (k-1) to count only primes q with
p_k<q .

Best wishes,

John


----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm

Reply via email to