A064427 a(n) = n + (number of primes < n).
1, 2, 4, 6, 7, 9, 10, 12, 13, 14, 15, 17, 18, 20, 21, 22, 23, 25, 26, 28, 29, 30, 31, 33, 34, 35, 36, 37, 38, 40, 41, 43, 44, 45, 46, 47, 48, 50, 51, 52, 53, 55, 56, 58, 59, 60, 61, 63, 64, 65, 66, 67, 68, 70, 71, 72, 73, 74, 75, 77, 78, 80, 81, 82
Offset: 1
Keywords
Links
- Reinhard Zumkeller, Table of n, a(n) for n = 1..10000
- Carlos Rivera, Puzzle 821. Prime numbers and complementary sequences, The Prime Puzzles & Problems Connection.
- Eric Weisstein's World of Mathematics, Prime Counting Function.
- Wikipedia, Prime-counting function.
Programs
-
Haskell
a064427 1 = 1 a064427 n = a000720 (n - 1) + toInteger n -- Reinhard Zumkeller, Apr 17 2012
-
Magma
[1] cat [#PrimesUpTo(n-1)+n: n in [2..100]]; // Vincenzo Librandi, Feb 13 2016
-
Mathematica
a[n_] := PrimePi[a[n-1]]+n; a[1]=1 Table[PrimePi[n-1]+n,{n,60}] (* Harvey P. Dale, Apr 03 2015 *)
-
PARI
a(n) = if (n==1, 1, primepi(n-1)+n); \\ Michel Marcus, Feb 13 2016
Formula
For n > 1: a(n) = n + A000720(n-1).
Extensions
Definition improved by Reinhard Zumkeller, Apr 16 2012
Edited by Jon E. Schoenfield, Nov 24 2023
Comments