OFFSET
1,2
LINKS
Harvey P. Dale, Table of n, a(n) for n = 1..1000
Index entries for linear recurrences with constant coefficients, signature (2, 1, -4, 1, 2, -1).
FORMULA
a(n+1) - a(n) = A093907(n-1), n>1.
a(n) = 2*a(n-1) +a(n-2) -4*a(n-3) +a(n-4) +2*a(n-5) -a(n-6).
G.f.: x*(1 - x^2 + 2*x)*(1 - x + x^2 + x^3)/( (1+x)^2 * (x-1)^4).
a(n+1) = A168380(n)+1.
From G. C. Greubel, Jul 19 2016: (Start)
a(n) = (12 + n + 3*(-1)^n*n + 2*n^3)/12.
E.g.f.: (1/12)*( -3*x - 12*exp(x) + (12 + 3*x + 6*x^2 + 2*x^3)*exp(2*x) )*exp(-x). (End)
MATHEMATICA
LinearRecurrence[{2, 1, -4, 1, 2, -1}, {1, 3, 5, 13, 21, 39}, 50] (* Harvey P. Dale, Nov 29 2014 *)
Table[(n + 1) (3 + 2 n^2 + 4 n - 3 (-1)^n)/12 + 1, {n, 0, 46}] (* Michael De Vlieger, Jul 19 2016, after Vincenzo Librandi at A168380 *)
PROG
(Magma) [(12+n+3*(-1)^n*n+2*n^3)/12: n in [1..60]]; // Vincenzo Librandi, Jul 20 2016
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
Paul Curtz, Nov 24 2009
EXTENSIONS
Edited and extended by R. J. Mathar, Mar 25 2010
STATUS
approved