login
a(1) = 1 and a(n) = a(n-1) + (the number of primes <= n) for n > 1.
2

%I #34 Mar 12 2021 06:19:12

%S 1,2,4,6,9,12,16,20,24,28,33,38,44,50,56,62,69,76,84,92,100,108,117,

%T 126,135,144,153,162,172,182,193,204,215,226,237,248,260,272,284,296,

%U 309,322,336,350,364,378,393,408,423,438,453,468,484,500,516,532,548

%N a(1) = 1 and a(n) = a(n-1) + (the number of primes <= n) for n > 1.

%H Harry J. Smith, <a href="/A061536/b061536.txt">Table of n, a(n) for n = 1..1000</a>

%F a(n) = 1 + A046992(n).

%t a[1] = 1; a[n_] := a[n - 1] + PrimePi[n]; Table[ a[n], {n, 1, 70} ]

%t Accumulate[PrimePi[Range[60]]]+1 (* _Harvey P. Dale_, Jun 11 2014 *)

%o (PARI) a=1; for (n=1, 100, print1(a+=primepi(n), ", ")) \\ _Harry J. Smith_, Jul 24 2009

%o (PARI) first(n)=my(p,s=1); vector(n,k, s+=p+=isprime(k)) \\ _Charles R Greathouse IV_, Jan 06 2016

%Y Cf. A000720, A046992.

%K nonn,easy

%O 1,2

%A _R. K. Guy_, _Robert G. Wilson v_, May 14 2001

%E Definition edited by _Georg Fischer_, Sep 04 2020