OFFSET
0,1
LINKS
Colin Barker, Table of n, a(n) for n = 0..1000
Hermann Stamm-Wilbrandt, 4 interlaced bisections
Index entries for linear recurrences with constant coefficients, signature (3,-1,-1).
FORMULA
a(n) = 3*a(n-1) - a(n-2) - a(n-3) with a(0)=2, a(1)=5, a(2)=13. - Hermann Stamm-Wilbrandt, Aug 26 2014
G.f.: (2-x)/((1-x)*(1-2*x-x^2)). - Robert Israel, Aug 26 2014
a(n) = 7*a(n-2) - 7*a(n-4) + a(n-6), for n>5. - Hermann Stamm-Wilbrandt, Aug 27 2014
a(2*n-1) = A006451(2*n), for n>0. - Hermann Stamm-Wilbrandt, Aug 27 2014
a(2*n) = A124124(2*n+2). - Hermann Stamm-Wilbrandt, Aug 27 2014
a(n) = (-2+(5-3*sqrt(2))*(1-sqrt(2))^n + (1+sqrt(2))^n*(5+3*sqrt(2)))/4. - Colin Barker, Mar 16 2016
MAPLE
A:= LREtools[REtoproc](a(n) = 3*a(n-1) - a(n-2) - a(n-3), a(n), {a(0)=2, a(1)=5, a(2)=13}):
seq(A(n), n=0..100); # Robert Israel, Aug 26 2014
MATHEMATICA
LinearRecurrence[{3, -1, -1}, {2, 5, 13}, 28] (* Hermann Stamm-Wilbrandt, Aug 26 2014 *)
CoefficientList[Series[(2-x)/((1-x)*(1-2*x-x^2)), {x, 0, 50}], x] (* G. C. Greubel, Feb 03 2018 *)
PROG
(PARI) Vec((2-x)/((1-x)*(1-2*x-x^2)) + O(x^50)) \\ Colin Barker, Mar 16 2016
(Magma) I:=[2, 5, 13]; [n le 3 select I[n] else 3*Self(n-1) - Self(n-2) - Self(n-3): n in [1..30]]; // G. C. Greubel, Feb 03 2018
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
Creighton Dement, Oct 03 2004
EXTENSIONS
Formula supplied by Thomas Baruchel, Oct 03 2004
More terms from Emeric Deutsch, Nov 17 2004
STATUS
approved