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!)
A082460 a(n) = pi(n) - a(n - 1) where pi(n) = A000720(n). 2

%I #26 Aug 11 2023 16:10:55

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

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

%U 17,1,17,1,17,1,18,1,18,1,19,1,20,1,20,1,20,1,21,1,21,1,22,1,22,1,22,1,23,1,23,1,23,1,23,1,24,1,24,1

%N a(n) = pi(n) - a(n - 1) where pi(n) = A000720(n).

%H Antti Karttunen, <a href="/A082460/b082460.txt">Table of n, a(n) for n = 1..16384</a>

%F a(1) = 0; after which, a(2n) = 1 and a(2n+1) = A000720(2n+1)-1. - _Antti Karttunen_, Nov 17 2019

%F a(n) = Sum_{k=1..n} (-1)^(n-k)*pi(k), where pi = A000720. - _Ridouane Oudra_, May 27 2023

%p with(numtheory): a:=proc(n) if n=1 then 0 elif (n mod 2)= 0 then 1 else pi(n)-1; fi: end proc: seq(a(n), n=1..100); # _Ridouane Oudra_, May 27 2023

%t f[x_] := PrimePi[x]-f[x-1] f[0]=0; Table[f[w],{w,1,128}]

%t nxt[{n_,a_}]:={n+1,PrimePi[n+1]-a}; NestList[nxt,{1,0},100][[All,2]] (* _Harvey P. Dale_, Jul 19 2021 *)

%o (PARI) k=pp=0;for(n=1,99,pp+=isprime(n);k=pp-k;print1(k", ")) \\ _Charles R Greathouse IV_, May 15 2013

%o (PARI) A082460(n) = if(1==n,0,if(!(n%2),1,primepi(n)-1)); \\ _Antti Karttunen_, Nov 17 2019

%Y Cf. A000720.

%K nonn

%O 1,5

%A _Labos Elemer_, Apr 26 2003

%E Offset corrected to 1 and more terms from _Antti Karttunen_, Nov 17 2019

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 April 25 16:39 EDT 2024. Contains 371989 sequences. (Running on oeis4.)