OFFSET
1,3
LINKS
Vincenzo Librandi, Table of n, a(n) for n = 1..10000
Index entries for linear recurrences with constant coefficients, signature (3,-4,4,-3,1).
FORMULA
a(n) = (1/4)*(3*(n^2-n-1) - (-1)^floor(n/2)), n > 1. - Ralf Stephan, Jun 09 2005
G.f.: x^2*(-1-x-2*x^3+x^4) / ( (x^2+1)*(x-1)^3 ). - R. J. Mathar, Oct 08 2011
MATHEMATICA
Join[{0}, LinearRecurrence[{3, -4, 4, -3, 1}, {1, 4, 8, 14, 22}, 60]] (* or *) Join[{0}, Table[(3 (n^2 - n - 1) - (-1)^(Floor[n/2]))/4, {n, 2, 55}]] (* Vincenzo Librandi, Aug 12 2018 *)
PROG
(Magma) [0] cat [(3*(n^2-n-1)-(-1)^(n div 2)) div 4: n in [2..60]]; // Vincenzo Librandi, Aug 12 2018
CROSSREFS
KEYWORD
nonn
AUTHOR
STATUS
approved