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^2 if n odd, a(n)=a(n-1)+ n^5 if n is even.
2

%I #12 Jan 02 2024 09:01:30

%S 1,33,42,1066,1091,8867,8916,41684,41765,141765,141886,390718,390887,

%T 928711,928936,1977512,1977801,3867369,3867730,7067730,7068171,

%U 12221803,12222332,20184956,20185581,32066957,32067686,49278054,49278895

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

%H Harvey P. Dale, <a href="/A140151/b140151.txt">Table of n, a(n) for n = 1..1000</a>

%F G.f.: x*(-1-32*x-3*x^2-832*x^3+14*x^4-2112*x^5-14*x^6-832*x^7+3*x^8-32*x^9+x^10 )/((1+x)^6*(x-1)^7). [From _R. J. Mathar_, Feb 22 2009]

%t a = {}; r = 2; s = 5; 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[{n_,a_}]:={n+1,If[EvenQ[n],a+(n+1)^2,a+(n+1)^5]}; Transpose[ NestList[ nxt,{1,1},30]][[2]] (* _Harvey P. Dale_, Aug 20 2015 *)

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

%K nonn

%O 1,2

%A _Artur Jasinski_, May 12 2008