[go: up one dir, main page]

login
A033270
Number of odd primes <= n.
11
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, 10, 10, 10, 11, 11, 11, 11, 12, 12, 13, 13, 13, 13, 14, 14, 14, 14, 14, 14, 15, 15, 15, 15, 15, 15, 16, 16, 17, 17, 17, 17
OFFSET
1,5
LINKS
FORMULA
a(n) = A000720(n) - 1, n > 1. - Reinhard Zumkeller, Sep 15 2011
G.f.: (1/(1 - x)) * Sum_{k>=2} x^prime(k). - Ilya Gutkovskiy, Sep 14 2019
MATHEMATICA
a[1] = 0; a[n_] := PrimePi[n] - 1; Array[a, 64] (* Jean-François Alcover, Nov 28 2017 *)
PROG
(Haskell)
a033270 n = a033270_list !! (n-1)
a033270_list = 0 : 0 : scanl1 (+) (drop 2 a010051_list)
-- Reinhard Zumkeller, Sep 15 2011
(PARI) a(n)=max(primepi(n)-1, 0) \\ Charles R Greathouse IV, Jun 25 2013
(Magma) A033270:=func<n|n le 1 select 0 else #PrimesUpTo(n)-1>; // Jason Kimberley, May 15 2018
CROSSREFS
KEYWORD
nonn
STATUS
approved