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 #31 Sep 08 2022 08:46:01
%S 0,0,4,9,19,35,62,106,178,295,485,793,1292,2100,3408,5525,8951,14495,
%T 23466,37982,61470,99475,160969,260469,421464,681960,1103452,1785441,
%U 2888923,4674395,7563350,12237778,19801162,32038975,51840173,83879185,135719396
%N a(n) = a(n-1) + a(n-2) + n + 2 with n>1, a(0)=a(1)=0.
%C Deleting the 0's leaves row 4 of the convolution array A213579. - _Clark Kimberling_, Jun 20 2012
%H Bruno Berselli, <a href="/A210730/b210730.txt">Table of n, a(n) for n = 0..1000</a>
%H <a href="/index/Rec#order_04">Index entries for linear recurrences with constant coefficients</a>, signature (3,-2,-1,1).
%F G.f.: x^2*(4-3*x)/((1-x)^2*(1-x-x^2)). - _Bruno Berselli_, May 10 2012
%F a(n) = A210677(n)-1. - _Bruno Berselli_, May 10 2012
%F a(0)=0, a(1)=0, a(2)=4, a(3)=9, a(n) = 3*a(n-1)-2*a(n-2)-a(n-3)+a(n-4). - _Harvey P. Dale_, Jul 24 2013
%F a(n) = -5 + (2^(-1-n)*((1-sqrt(5))^n*(-7+5*sqrt(5)) + (1+sqrt(5))^n*(7+5*sqrt(5)))) / sqrt(5) - n. - _Colin Barker_, Mar 11 2017
%F a(n) = Fibonacci(n+3) + 3*Fibonacci(n+1) - n - 5. - _G. C. Greubel_, Jul 08 2019
%t RecurrenceTable[{a[0]==a[1]==0, a[n]==a[n-1] +a[n-2] +n+2}, a, {n, 40}] (* _Bruno Berselli_, May 10 2012 *)
%t LinearRecurrence[{3,-2,-1,1},{0,0,4,9},40] (* _Harvey P. Dale_, Jul 24 2013 *)
%t With[{F=Fibonacci}, Table[F[n+3]+2*F[n+1]-n-5, {n, 40}]] (* _G. C. Greubel_, Jul 08 2019 *)
%o (Magma) I:=[0, 0, 4, 9]; [n le 4 select I[n] else 3*Self(n-1)-2*Self(n-2)-Self(n-3)+Self(n-4): n in [1..37]]; // _Bruno Berselli_, May 10 2012
%o (Magma) F:=Fibonacci; [F(n+3)+3*F(n+1)-n-5: n in [0..40]]; # _G. C. Greubel_, Jul 08 2019
%o (PARI) concat(vector(2), Vec(x^2*(4-3*x)/((1-x)^2*(1-x-x^2)) + O(x^50))) \\ _Colin Barker_, Mar 11 2017
%o (PARI) vector(40, n, n--; f=fibonacci; f(n+3)+3*f(n+1)-n-5) \\ _G. C. Greubel_, Jul 08 2019
%o (Sage) f=fibonacci; [f(n+3)+3*f(n+1)-n-5 for n in (0..40)] # _G. C. Greubel_, Jul 08 2019
%o (GAP) F:=Fibonacci;; List([0..40], n-> F(n+3)+3*F(n+1)-n-5) # _G. C. Greubel_, Jul 08 2019
%Y Cf. A033818: a(n)=a(n-1)+a(n-2)+n-5, a(0)=a(1)=0 (except first 2 terms and sign).
%Y Cf. A002062: a(n)=a(n-1)+a(n-2)+n-4, a(0)=a(1)=0 (except the first term and sign).
%Y Cf. A065220: a(n)=a(n-1)+a(n-2)+n-3, a(0)=a(1)=0.
%Y Cf. A001924: a(n)=a(n-1)+a(n-2)+n-1, a(0)=a(1)=0 (except the first term).
%Y Cf. A023548: a(n)=a(n-1)+a(n-2)+n, a(0)=a(1)=0 (except first 2 terms).
%Y Cf. A023552: a(n)=a(n-1)+a(n-2)+n+1, a(0)=a(1)=0 (except first 2 terms).
%Y Cf. A210731: a(n)=a(n-1)+a(n-2)+n+3, a(0)=a(1)=0.
%Y Cf. A000045, A213579.
%K nonn,easy
%O 0,3
%A _Alex Ratushnyak_, May 10 2012