login
A140163
a(1)=1, a(n) = a(n-1) + n^5 if n odd, a(n) = a(n-1) + n if n is even.
2
1, 3, 246, 250, 3375, 3381, 20188, 20196, 79245, 79255, 240306, 240318, 611611, 611625, 1371000, 1371016, 2790873, 2790891, 5266990, 5267010, 9351111, 9351133, 15787476, 15787500, 25553125, 25553151, 39902058, 39902086, 60413235
OFFSET
1,2
LINKS
Index entries for linear recurrences with constant coefficients, signature (1,6,-6,-15,15,20,-20,-15,15,6,-6, -1,1).
FORMULA
G.f.: -x*(1 + 2*x + 237*x^2 - 8*x^3 + 1682*x^4 + 12*x^5 + 1682*x^6 - 8*x^7 + 237*x^8 + 2*x^9 + x^10)/((1+x)^6*(x-1)^7). - R. J. Mathar, Feb 22 2009
a(n) = (1/24)*(n + n^2)*(6*(1 + (-1)^n) - (1 - 9*(-1)^n)*n + (1 - 9*(-1)^n)*n^2 + (4 - 6*(-1)^n)*n^3 + 2*n^4). - G. C. Greubel, Jul 05 2018
MAPLE
a:=proc(n) option remember: if n=1 then 1 elif modp(n, 2)<>0 then procname(n-1)+n^5 else procname(n-1)+n; fi: end; seq(a(n), n=1..30); # Muniru A Asiru, Jul 07 2018
MATHEMATICA
Table[(1/24)*(n +n^2)*(6*(1 +(-1)^n) - (1-9*(-1)^n)*n + (1 -9*(-1)^n)*n^2 + (4 -6*(-1)^n)*n^3 + 2*n^4), {n, 1, 50}] (* or *) LinearRecurrence[{1, 6, -6, -15, 15, 20, -20, -15, 15, 6, -6, -1, 1}, {1, 3, 246, 250, 3375, 3381, 20188, 20196, 79245, 79255, 240306, 240318, 611611}, 60] (* G. C. Greubel, Jul 05 2018 *)
PROG
(PARI) for(n=1, 50, print1((1/24)*(n +n^2)*(6*(1 +(-1)^n) - (1-9*(-1)^n)*n + (1 -9*(-1)^n)*n^2 + (4 -6*(-1)^n)*n^3 + 2*n^4), ", ")) \\ G. C. Greubel, Jul 05 2018
(Magma) [(1/24)*(n +n^2)*(6*(1 +(-1)^n) - (1-9*(-1)^n)*n + (1 -9*(-1)^n)*n^2 + (4 -6*(-1)^n)*n^3 + 2*n^4): n in [1..50]]; // G. C. Greubel, Jul 05 2018
KEYWORD
nonn
AUTHOR
Artur Jasinski, May 12 2008
STATUS
approved