OFFSET
0,2
LINKS
Colin Barker, Table of n, a(n) for n = 0..1000
Index entries for linear recurrences with constant coefficients, signature (2,0,-1).
FORMULA
From R. J. Mathar, Apr 07 2011: (Start)
G.f. -x*(-4+3*x) / ( (x-1)*(x^2+x-1) ).
a(n) = A022095(n) - 1. (End)
From Colin Barker, Feb 20 2017: (Start)
a(n) = -1 + (2^(-1-n)*((1-t)^n*(-9+t) + (1+t)^n*(9+t)))/t, where t=sqrt(5).
a(n) = 2*a(n-1) - a(n-3) for n>2. (End)
a(n) = 5*F(n) + F(n-1) - 1, where F = A000045. - Bruno Berselli, Feb 20 2017
MATHEMATICA
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 *)
PROG
(PARI) concat(0, Vec(x*(4-3*x) / ((1-x)*(1-x-x^2)) + O(x^50))) \\ Colin Barker, Feb 20 2017
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
STATUS
approved