login

Reminder: The OEIS is hiring a new managing editor, and the application deadline is January 26.

a(1)=1, a(n)=a(n-1)+n^3 if n odd, a(n)=a(n-1)+ n^0 if n is even.
1

%I #13 Jan 02 2024 09:01:33

%S 1,2,29,30,155,156,499,500,1229,1230,2561,2562,4759,4760,8135,8136,

%T 13049,13050,19909,19910,29171,29172,41339,41340,56965,56966,76649,

%U 76650,101039,101040,130831,130832,166769,166770,209645,209646,260299

%N a(1)=1, a(n)=a(n-1)+n^3 if n odd, a(n)=a(n-1)+ n^0 if n is even.

%F a(n) = a(n-1)+4*a(n-2)-4*a(n-3)-6*a(n-4)+6*a(n-5)+4*a(n-6)-4*a(n-7)-a(n-8)+a(n-9). G.f.: x*(-1-x-23*x^2+3*x^3-23*x^4-3*x^5-x^6+x^7)/((1+x)^4*(x-1)^5). [_R. J. Mathar_, Feb 22 2009]

%t a = {}; r = 3; s = 0; Do[k = 0; Do[k = k + (Sin[Pi m/2]^2) m^r + (Cos[Pi m/2]^2) m^s, {m, 1, n}]; AppendTo[a, k], {n, 1, 100}]; a (*Artur Jasinski*)

%t nxt[{a_,b_}]:={a+1,If[EvenQ[a],b+(a+1)^3,b+1]}; Transpose[NestList[nxt,{1,1},40]][[2]] (* _Harvey P. Dale_, Dec 13 2011 *)

%Y Cf. A000027, A000217, A000330, A000537, A000538, A000539, A136047, A140113.

%K nonn

%O 1,2

%A _Artur Jasinski_, May 12 2008