A140142 a(1)=1, a(n)=a(n-1)+n^0 if n odd, a(n)=a(n-1)+ n^4 if n is even.
1, 17, 18, 274, 275, 1571, 1572, 5668, 5669, 15669, 15670, 36406, 36407, 74823, 74824, 140360, 140361, 245337, 245338, 405338, 405339, 639595, 639596, 971372, 971373, 1428349, 1428350, 2043006, 2043007, 2853007, 2853008, 3901584, 3901585
Offset: 1
Keywords
Links
- Harvey P. Dale, Table of n, a(n) for n = 1..1000
Programs
-
Maple
a:= n-> (Matrix([[275,274,18,17, 1,0,0,-1,-17, -18,-274]]). Matrix(11, (i,j)-> if (i=j-1) then 1 elif j=1 then [1,5,-5,-10,10,10, -10,-5,5,1,-1][i] else 0 fi)^n)[1,6]: seq(a(n), n=1..33); # Alois P. Heinz, Aug 06 2008
-
Mathematica
a = {}; r = 0; s = 4; 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 *) nxt[{n_,a_}]:={n+1,If[OddQ[n+1],a+1,a+(n+1)^4]}; Transpose[ NestList[ nxt,{1,1},40]][[2]] (* Harvey P. Dale, Dec 24 2012 *)
Formula
O.g.f.: x*(x^8+16*x^7-4*x^6+176*x^5+6*x^4+176*x^3-4*x^2+16*x+1)/((-1+x)^6*(1+x)^5) - R. J. Mathar, May 17 2008