Year-end appeal: Please make a donation to the OEIS Foundation to support ongoing development and maintenance of the OEIS. We are now in our 61st year, we have over 378,000 sequences, and we’ve reached 11,000 citations (which often say “discovered thanks to the OEIS”).
%I #29 Mar 28 2024 13:19:10
%S 1,1,1,1,4,8,16,32,64,125,243,471,911,1759,3394,6546,12622,24334,
%T 46910,90427,174309,335997,647661,1248413,2406400,4638492,8940988,
%U 17234316,33220220,64034041,123429591,237918195,458602075,883983931,1703933822,3284438054
%N a(n) = a(n-4) + a(n-3) + a(n-2) + a(n-1) + (n-5).
%H Alois P. Heinz, <a href="/A196875/b196875.txt">Table of n, a(n) for n = 1..1000</a>
%H <a href="/index/Rec#order_06">Index entries for linear recurrences with constant coefficients</a>, signature (3,-2,0,0,-1,1).
%F G.f.: (x^5-3*x^4+2*x-1)*x / ((x^4+x^3+x^2+x-1)*(x-1)^2 ).
%F a(n) = +3*a(n-1) -2*a(n-2) -a(n-5) +a(n-6).
%F 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
%p 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
%t 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 *)
%t 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 *)
%Y Cf. A000126, A196787.
%K nonn,easy
%O 1,5
%A _Aditya Subramanian_, Oct 07 2011