A140162 a(1)=1, a(n) = a(n-1) + n^5 if n odd, a(n) = a(n-1) + n^0 if n is even.
1, 2, 245, 246, 3371, 3372, 20179, 20180, 79229, 79230, 240281, 240282, 611575, 611576, 1370951, 1370952, 2790809, 2790810, 5266909, 5266910, 9351011, 9351012, 15787355, 15787356, 25552981, 25552982, 39901889, 39901890, 60413039
Offset: 1
Keywords
Links
- G. C. Greubel, Table of n, a(n) for n = 1..1000
- Index entries for linear recurrences with constant coefficients, signature (1, 6, -6, -15, 15, 20, -20, -15, 15, 6, -6, -1, 1).
Programs
-
Magma
[(1/24)*(3*(-1 +(-1)^n) + 12*n + (-1 +15*(-1)^n)*n^2 + 5*(1 -3* (-1)^n)*n^4 - 6*(-1 +(-1)^n)*n^5 + 2*n^6): n in [1..50]]; // G. C. Greubel, Jul 05 2018
-
Mathematica
a = {}; r = 5; 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 *) LinearRecurrence[{1,6,-6,-15,15,20,-20,-15,15,6,-6,-1,1},{1,2,245,246, 3371,3372,20179,20180,79229,79230,240281,240282,611575},40] (* Harvey P. Dale, Apr 21 2011 *)
-
PARI
for(n=1,50, print1((1/24)*(3*(-1 +(-1)^n) + 12*n + (-1 +15*(-1)^n)*n^2 + 5*(1 -3* (-1)^n)*n^4 - 6*(-1 +(-1)^n)*n^5 + 2*n^6), ", ")) \\ G. C. Greubel, Jul 05 2018
Formula
G.f.: x*(-1 - x - 237*x^2 + 5*x^3 - 1682*x^4 - 10*x^5 - 1682*x^6 + 10*x^7 - 237*x^8 - 5*x^9 - x^10 + x^11)/((1+x)^6*(x-1)^7). - R. J. Mathar, Feb 22 2009