OFFSET
1,5
LINKS
Alois P. Heinz, Table of n, a(n) for n = 1..1000
Index entries for linear recurrences with constant coefficients, signature (3,-2,0,0,-1,1).
FORMULA
G.f.: (x^5-3*x^4+2*x-1)*x / ((x^4+x^3+x^2+x-1)*(x-1)^2 ).
a(n) = +3*a(n-1) -2*a(n-2) -a(n-5) +a(n-6).
a(n) = 5/9-n/3 +(10*A000078(n) +17*A000078(n+1) +21*A000078(n+2) -14*A000078(n+3))/9. - R. J. Mathar, Oct 16 2011
MAPLE
a:= n-> (Matrix(6, (i, j)-> `if`(i=j-1, 1, `if`(i=6, [1, -1, 0, 0, -2, 3][j], 0)))^n. <<-1, 1, 1, 1, 1, 4>>)[1, 1]: seq(a(n), n=1..50); # Alois P. Heinz, Oct 15 2011
MATHEMATICA
nn = 40; a[1] = a[2] = a[3] = a[4] = 1; Do[a[n] = a[n - 1] + a[n - 2] + a[n - 3] + a[n - 4] + (n - 5), {n, 5, nn}]; Table[a[n], {n, nn}] (* T. D. Noe, Oct 07 2011 *)
RecurrenceTable[{a[1]==a[2]==a[3]==a[4]==1, a[n]==a[n-1]+a[n-2]+a[n-3]+a[n-4]+(n-5)}, a, {n, 40}] (* or *) LinearRecurrence[{3, -2, 0, 0, -1, 1}, {1, 1, 1, 1, 4, 8}, 40] (* Harvey P. Dale, Aug 25 2014 *)
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
Aditya Subramanian, Oct 07 2011
STATUS
approved