A095117 a(n) = pi(n) + n, where pi(n) = A000720(n) is the number of primes <= n.
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
Offset: 0
Links
- Carmine Suriano, Table of n, a(n) for n = 0..9999
- Ya-Ping Lu, Lower Bounds for the Number of Primes in Some Integer Intervals
Programs
-
Haskell
a095117 n = a000720 n + toInteger n -- Reinhard Zumkeller, Apr 17 2012
-
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 *)
-
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
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
Extensions
Edited by N. J. A. Sloane, Jul 02 2008 at the suggestion of R. J. Mathar
Comments