login
a(n) = n + (number of primes < n).
4

%I #35 Nov 24 2023 08:59:14

%S 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,

%T 35,36,37,38,40,41,43,44,45,46,47,48,50,51,52,53,55,56,58,59,60,61,63,

%U 64,65,66,67,68,70,71,72,73,74,75,77,78,80,81,82

%N a(n) = n + (number of primes < n).

%C From _Jaroslav Krizek_, Dec 10 2009: (Start)

%C Complement of A014688.

%C Numbers that are not the sum of k and the k-th prime for any k >= 1. (End)

%H Reinhard Zumkeller, <a href="/A064427/b064427.txt">Table of n, a(n) for n = 1..10000</a>

%H Carlos Rivera, <a href="http://www.primepuzzles.net/puzzles/puzz_821.htm">Puzzle 821. Prime numbers and complementary sequences</a>, The Prime Puzzles & Problems Connection.

%H Eric Weisstein's World of Mathematics, <a href="http://mathworld.wolfram.com/PrimeCountingFunction.html">Prime Counting Function</a>.

%H Wikipedia, <a href="http://en.wikipedia.org/wiki/Prime-counting_function">Prime-counting function</a>.

%F For n > 1: a(n) = n + A000720(n-1).

%t a[n_] := PrimePi[a[n-1]]+n; a[1]=1

%t Table[PrimePi[n-1]+n,{n,60}] (* _Harvey P. Dale_, Apr 03 2015 *)

%o (Haskell)

%o a064427 1 = 1

%o a064427 n = a000720 (n - 1) + toInteger n

%o -- _Reinhard Zumkeller_, Apr 17 2012

%o (PARI) a(n) = if (n==1, 1, primepi(n-1)+n); \\ _Michel Marcus_, Feb 13 2016

%o (Magma) [1] cat [#PrimesUpTo(n-1)+n: n in [2..100]]; // _Vincenzo Librandi_, Feb 13 2016

%Y Cf. A000720, A014688, A095117.

%K nonn

%O 1,2

%A _Santi Spadaro_, Sep 30 2001

%E Definition improved by _Reinhard Zumkeller_, Apr 16 2012

%E Edited by _Jon E. Schoenfield_, Nov 24 2023