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

%I #25 Feb 20 2017 08:14:28

%S 0,4,5,10,16,27,44,72,117,190,308,499,808,1308,2117,3426,5544,8971,

%T 14516,23488,38005,61494,99500,160995,260496,421492,681989,1103482,

%U 1785472,2888955,4674428,7563384,12237813,19801198,32039012,51840211,83879224,135719436

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

%H Colin Barker, <a href="/A022309/b022309.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 From _R. J. Mathar_, Apr 07 2011: (Start)

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

%F a(n) = A022095(n) - 1. (End)

%F From _Colin Barker_, Feb 20 2017: (Start)

%F a(n) = -1 + (2^(-1-n)*((1-t)^n*(-9+t) + (1+t)^n*(9+t)))/t, where t=sqrt(5).

%F a(n) = 2*a(n-1) - a(n-3) for n>2. (End)

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

%t RecurrenceTable[{a[0]==0,a[1]==4,a[n]==a[n-1]+a[n-2]+1},a,{n,40}] (* or *) CoefficientList[Series[-x(-4+3x)/((x-1)(x^2+x-1)),{x,0,40}],x] (* _Harvey P. Dale_, Apr 24 2011 *)

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

%Y Cf. A000045, A022095, A022308.

%K nonn,easy

%O 0,2

%A _N. J. A. Sloane_