OFFSET
1,4
LINKS
Index entries for linear recurrences with constant coefficients, signature (3,-2,0,-1,1).
FORMULA
a(1)=1, a(2)=1, a(3)=1; a(n) = a(n-1) + a(n-2) + a(n-3) + n - 4 for n >= 4.
G.f.: x*(-1+2*x-2*x^3) / ((x-1)^2*(x^3+x^2+x-1)).
EXAMPLE
a(7) = (a(6): 12) + (a(5): 6) + (a(4): 3) + (n-4: 3) = 24.
MATHEMATICA
LinearRecurrence[{3, -2, 0, -1, 1}, {1, 1, 1, 3, 6}, 42] (* T. D. Noe, Oct 06 2011 *)
PROG
(PARI) x='x+O('x^43); Vec(x*(-1+2*x-2*x^3) / ((x-1)^2*(x^3+x^2+x-1))) \\ Georg Fischer, Apr 03 2019
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
Aditya Subramanian, Oct 06 2011
EXTENSIONS
Better name from Charles R Greathouse IV, Oct 06 2011
Edited and corrected by Georg Fischer, Apr 03 2019
STATUS
approved