OFFSET
0,3
COMMENTS
Positions of first occurrences of n in A165634: A165634(a(n))=n for n>0. - Reinhard Zumkeller, Sep 23 2009
There exists at least one prime number p such that n < p <= a(n) for n >= 2. For example, 2 is in (2, 3], 5 in (3, 5], 5 in (4, 6], ..., and primes 73, 79, 83 and 89 are in (71, 91] (see Corollary 1 in the paper by Ya-Ping Lu attached in the links section). - Ya-Ping Lu, Feb 21 2021
LINKS
Carmine Suriano, Table of n, a(n) for n = 0..9999
FORMULA
a(0) = 0; for n>0, a(n) = a(n-1) + (if n is prime then 2, else 1). - Robert G. Wilson v, Apr 22 2007; corrected by David James Sycamore, Aug 16 2018
MAPLE
with(numtheory): seq(n+pi(n), n=1..90); # Emeric Deutsch, May 02 2007
MATHEMATICA
Table[ PrimePi@n + n, {n, 0, 71}] (* Robert G. Wilson v, Apr 22 2007 *)
PROG
(Haskell)
a095117 n = a000720 n + toInteger n -- Reinhard Zumkeller, Apr 17 2012
(PARI) a(n) = n + primepi(n); \\ Michel Marcus, Feb 21 2021
(Python)
from sympy import primepi
def a(n): return primepi(n) + n
print([a(n) for n in range(72)]) # Michael S. Branicky, Feb 21 2021
CROSSREFS
KEYWORD
easy,nonn
AUTHOR
Dean Hickerson, following a suggestion of Leroy Quet, May 28 2004
EXTENSIONS
Edited by N. J. A. Sloane, Jul 02 2008 at the suggestion of R. J. Mathar
STATUS
approved