OFFSET
0,1
LINKS
Vincenzo Librandi, Table of n, a(n) for n = 0..1000
Index entries for linear recurrences with constant coefficients, signature (3, -2, -1, 1).
FORMULA
a(n) = a(n-1) + a(n-2) - n + 3.
From R. J. Mathar, Nov 04 2009: (Start)
a(n) = 3*a(n-1) - 2*a(n-2) - a(n-3) + a(n-4).
G.f.: (-3 + 6*x - 4*x^2 + 2*x^3)/((x^2+x-1) * (x-1)^2).
a(n) = n + A013655(n). (End)
MATHEMATICA
LinearRecurrence[{3, -2, -1, 1}, {3, 3, 7, 10}, 40] (* Vincenzo Librandi, Feb 14 2012 *)
PROG
(Magma) I:=[3, 3, 7, 10]; [n le 4 select I[n] else 3*Self(n-1)-2*Self(n-2)-Self(n-3)+Self(n-4): n in [1..50]]; // Vincenzo Librandi, Feb 14 2012
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
EXTENSIONS
More terms from Erich Friedman
STATUS
approved