OFFSET
0,2
LINKS
G. C. Greubel, Table of n, a(n) for n = 0..1000
Richard Choulet, Curtz-like transformation.
Index entries for linear recurrences with constant coefficients, signature (3,-2,1).
FORMULA
O.g.f.: f(z) = ((1-z)^2/(1-3*z+2*z^2-z^3))*(1-z^2+z^4-z^6)+(z/(1-3*z+2*z^2-z^3)).
a(n) = 3*a(n-1) - 2*a(n-2) + a(n-3) for n >= 9, with a(0)=1, a(1)=2, a(2)=4, a(3)=11, a(4)=27, a(5)=61, a(6)=140, a(7)=327, a(8)=761.
MAPLE
a(0):=1: a(1):=2:a(2):=4: a(3):=11:a(4):=27:a(5):=61:a(6):=140:a(7):=327:a(8):=761:for n from 6 to 31 do a(n+3):=3*a(n+2)-2*a(n+1)+a(n):od:seq(a(i), i=0..31);
MATHEMATICA
Join[{1, 2, 4, 11, 27, 61}, LinearRecurrence[{3, -2, 1}, {140, 327, 761}, 45]] (* G. C. Greubel, Jun 25 2018 *)
PROG
(PARI) z='z+O('z^50); Vec(((1-z)^2/(1-3*z+2*z^2-z^3))*(1-z^2+z^4-z^6)+(z/(1-3*z+2*z^2-z^3))) \\ G. C. Greubel, Jun 25 2018
(Magma) I:=[140, 327, 761]; [1, 2, 4, 11, 27, 61] cat [n le 3 select I[n] else 3*Self(n-1) - 2*Self(n-2) + Self(n-3): n in [1..50]]; // G. C. Greubel, Jun 25 2018
CROSSREFS
KEYWORD
easy,nonn
AUTHOR
Richard Choulet, Apr 11 2009
STATUS
approved