OFFSET
1,2
COMMENTS
Except for the first few terms, corresponding terms in this sequence and the one using pi(n) are equal. If we define Li(1) = 0 then the terms will differ by 1 since we carry the pi(n) calculation to pi(1) which is 0.
LINKS
Andrew Booker, The Nth Prime Page.
FORMULA
Li(n) = logarithmic integral Li(x) = integral(x=2..n, dx/log(x)) ~ pi(n) = number of primes less than or equal to n. Repeating n = Li(n), n will reach 1 in a finite number of steps.
PROG
(PARI) Li(x) = -eint1(-log(x))
pr2nLi(n) = my(c); for(x=1, n, y=2^x; c=0; p=y; while(p > 1, p = floor(Li(p)); c++); print(x" "c", "))
CROSSREFS
KEYWORD
easy,nonn
AUTHOR
Cino Hilliard, Mar 16 2004
STATUS
approved