OFFSET
0,3
COMMENTS
LINKS
Stefano Spezia, Table of n, a(n) for n = 0..10000
Christian Krause, LODA, an assembly language, a computational model and a tool for mining integer sequences
Index entries for linear recurrences with constant coefficients, signature (2,1,-4,1,2,-1).
FORMULA
O.g.f.: 2*x^2*(2 + 3*x + x^3)/((1 - x)^4*(1 + x)^2).
E.g.f.: (1/4)*exp(-x)*(2 + x)*(1 + exp(2*x)*(-1 + 2*x + 2* x^2)).
a(n) = 2*a(n-1) + a(n-2) - 4*a(n-3) + a(n-4) + 2*a(n-5) - a(n-6) for n > 5.
a(n) = (6 + n + n^3 + 12*floor((n - 3)/2) + 4*floor((n - 3)/2)^2 - 2*(1 + n)*floor((n - 1)/2)/2.
a(n) = n^3/2 for even n; a(n) = (n - 1)*(n^2 + n + 2)/2 otherwise. - Bruno Berselli, Feb 06 2019
a(n) = 2*A004526(n*A000982(n)). [Found by Christian Krause's LODA miner] - Stefano Spezia, Dec 12 2021
MAPLE
a:=n->(-2 - (-1)^n*(-2 + n) + n + 2*n^3)/4: seq(a(n), n=0..50);
MATHEMATICA
a[n_]:=(6 + n + n^3 + 12 Floor[1/2 (-3 + n)] + 4 Floor[1/2 (-3 + n)]^2 - 2 (1 + n) Floor[1/2 (-1 + n)])/2; Array[a, 50, 0]
PROG
(GAP) Flat(List([0..50], n -> (-2-(-1)^n*(-2+n)+n+2*n^3)/4));
(Magma) [(-2-(-1)^n*(-2+n)+n+2*n^3)/4: n in [0..50]];
(Maxima) makelist((-2-(-1)^n*(-2+n)+n+2*n^3)/4, n, 0, 50);
(PARI) a(n) = (-2-(-1)^n*(-2+n)+n+2*n^3)/4;
(Python) [(-2-(-1)**n*(-2+n)+n+2*n**3)/4 for n in range(50)]
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
Stefano Spezia, Jan 25 2019
STATUS
approved