login
a(n) = a(n-1) + a(n-2) + 1 for n>1, a(0)=0, a(1)=3.
5

%I #41 Mar 26 2018 11:45:48

%S 0,3,4,8,13,22,36,59,96,156,253,410,664,1075,1740,2816,4557,7374,

%T 11932,19307,31240,50548,81789,132338,214128,346467,560596,907064,

%U 1467661,2374726,3842388,6217115,10059504,16276620,26336125,42612746,68948872,111561619

%N a(n) = a(n-1) + a(n-2) + 1 for n>1, a(0)=0, a(1)=3.

%H Colin Barker, <a href="/A022308/b022308.txt">Table of n, a(n) for n = 0..1000</a>

%H <a href="/index/Rec#order_03">Index entries for linear recurrences with constant coefficients</a>, signature (2,0,-1).

%F G.f.: x*(3-2*x) / (x^3-2*x+1).

%F a(n) = 2*A000045(n) + A000045(n+2) - 1 = A000285(n)-1.

%F a(n) = 2*a(n-1) - a(n-3) for n>=3. - _Ron Knott_, Aug 25 2006

%F a(n) = (3*A000032(n) - A000045(n) - 2)/2. - _Vladimir Joseph Stephan Orlovsky_, Feb 02 2012

%F a(n) = 4*F(n) + F(n-1) - 1, where F = A000045. - _Bruno Berselli_, Feb 20 2017

%F a(n) = (-10 + (5-7*sqrt(5))*((1-sqrt(5))/2)^n + ((1+sqrt(5))/2)^n*(5+7*sqrt(5))) / 10. - _Colin Barker_, Feb 20 2017

%p with(combinat): seq(fibonacci(n)+fibonacci(n+5)-1, n=-2..30); # _Zerinvary Lajos_, Feb 01 2008

%t Table[(3 LucasL[n] - Fibonacci[n] - 2)/2, {n, 40}] (* _Vladimir Joseph Stephan Orlovsky_, Feb 02 2012 *)

%t LinearRecurrence[{2, 0, -1}, {0, 3, 4}, 40] (* _Vladimir Joseph Stephan Orlovsky_, Feb 02 2012 *)

%t CoefficientList[Series[x (3 - 2 x)/(x^3 - 2 x + 1), {x, 0, 20}], x] (* _Eric W. Weisstein_, Mar 26 2018 *)

%o (PARI) concat(0, Vec(x*(3-2*x)/(x^3-2*x+1) + O(x^50))) \\ _Colin Barker_, Feb 20 2017

%o (PARI) a(n) = if(n==0, 0, if(n==1, 3, a(n-1)+a(n-2)+1)) \\ _Felix Fröhlich_, Mar 26 2018

%Y Cf. A000032, A000045, A000285, A122195.

%K nonn,easy

%O 0,2

%A _N. J. A. Sloane_