

A095117


a(n) = pi(n) + n, where pi(n) = A000720(n) is the number of primes <= n.


7



0, 1, 3, 5, 6, 8, 9, 11, 12, 13, 14, 16, 17, 19, 20, 21, 22, 24, 25, 27, 28, 29, 30, 32, 33, 34, 35, 36, 37, 39, 40, 42, 43, 44, 45, 46, 47, 49, 50, 51, 52, 54, 55, 57, 58, 59, 60, 62, 63, 64, 65, 66, 67, 69, 70, 71, 72, 73, 74, 76, 77, 79, 80, 81, 82, 83, 84, 86, 87, 88, 89, 91
(list;
graph;
refs;
listen;
history;
text;
internal format)



OFFSET

0,3


COMMENTS

From Paolo P. Lava, Jun 05 2008 (Start):
Consider the sequence of natural numbers A000027: 1,2,3,4,5,6,7,8....
Taking Pn=nth prime, apply the following sieve:
Delete the number in position P1=2 > 2 and compact:
1,3,4,5,6,7,8....
Then delete the number in position P2=3 >4 and compact:
1,3,5,6,7,8,9,10,11..
Then delete the number in position P3=5 >7 and compact:
1,3,5,6,8,9,10,11
and so on. (End)
Positions of first occurrences of n in A165634: A165634(a(n))=n for n>0.  Reinhard Zumkeller, Sep 23 2009


LINKS

Carmine Suriano, Table of n, a(n) for n = 0..9999


FORMULA

a(0) = 0; for n>0, a(n) = a(n1) + (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}] (* Or *) (* Robert G. Wilson v, Apr 22 2007 *)
a[0] = 0; a[n_] := a[n] = a[n  1] + If[PrimeQ@n, 2, 1]; Table[a@n, {n, 0, 71}] (* Robert G. Wilson v, Apr 22 2007 *)


PROG

(Haskell)
a095117 n = a000720 n + toInteger n  Reinhard Zumkeller, Apr 17 2012


CROSSREFS

Complement of A095116.
Cf. A064427.
Sequence in context: A153264 A249595 A133561 * A184675 A121506 A114119
Adjacent sequences: A095114 A095115 A095116 * A095118 A095119 A095120


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



