The OEIS mourns the passing of Jim Simons and is grateful to the Simons Foundation for its support of research in many branches of science, including the OEIS.
login
The OEIS is supported by the many generous donors to the OEIS Foundation.

 

Logo
Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A033270 Number of odd primes <= n. 11

%I #35 Jan 20 2024 17:43:11

%S 0,0,1,1,2,2,3,3,3,3,4,4,5,5,5,5,6,6,7,7,7,7,8,8,8,8,8,8,9,9,10,10,10,

%T 10,10,10,11,11,11,11,12,12,13,13,13,13,14,14,14,14,14,14,15,15,15,15,

%U 15,15,16,16,17,17,17,17

%N Number of odd primes <= n.

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

%F a(n) = A000720(n) - 1, n > 1. - _Reinhard Zumkeller_, Sep 15 2011

%F G.f.: (1/(1 - x)) * Sum_{k>=2} x^prime(k). - _Ilya Gutkovskiy_, Sep 14 2019

%t a[1] = 0; a[n_] := PrimePi[n] - 1; Array[a, 64] (* _Jean-François Alcover_, Nov 28 2017 *)

%o (Haskell)

%o a033270 n = a033270_list !! (n-1)

%o a033270_list = 0 : 0 : scanl1 (+) (drop 2 a010051_list)

%o -- _Reinhard Zumkeller_, Sep 15 2011

%o (PARI) a(n)=max(primepi(n)-1,0) \\ _Charles R Greathouse IV_, Jun 25 2013

%o (Magma) A033270:=func<n|n le 1 select 0 else #PrimesUpTo(n)-1>; // _Jason Kimberley_, May 15 2018

%Y Cf. A000720, A065091, A304484.

%K nonn

%O 1,5

%A _N. J. A. Sloane_

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recents
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified May 21 07:02 EDT 2024. Contains 372729 sequences. (Running on oeis4.)