login

Year-end appeal: Please make a donation to the OEIS Foundation to support ongoing development and maintenance of the OEIS. We are now in our 61st year, we have over 378,000 sequences, and we’ve reached 11,000 citations (which often say “discovered thanks to the OEIS”).

A100296
Expansion of g.f. x*(1+2*x-x^2)/(1-4*x-2*x^2+x^3).
2
1, 6, 25, 111, 488, 2149, 9461, 41654, 183389, 807403, 3554736, 15650361, 68903513, 303360038, 1335596817, 5880203831, 25888648920, 113979406525, 501814720109, 2209329044566, 9726966211957, 42824708216851, 188543436246752, 830096195208753, 3654646945111665
OFFSET
1,2
FORMULA
a(n) = 4*a(n-1) + 2*a(n-2) - a(n-3).
G.f.: x*(1+2*x-x^2)/(1-4*x-2*x^2+x^3). - Colin Barker, May 25 2013
EXAMPLE
a(8) = 4*a(7) + 2*a(6) - a(5) = 41654 = 4*9461 + 2*2149 - 488.
MAPLE
a:= n-> (<<3|2|1>, <2|1|0>, <1|0|0>>^n. <<1, 1, 1>>)[3, 1]:
seq(a(n), n=1..30); # Alois P. Heinz, Feb 06 2023
MATHEMATICA
LinearRecurrence[{4, 2, -1}, {1, 6, 25}, 40] (* G. C. Greubel, Feb 05 2023 *)
PROG
(Magma) I:=[1, 6, 25]; [n le 3 select I[n] else 4*Self(n-1) +2*Self(n-2) -Self(n-3): n in [1..40]]; // G. C. Greubel, Feb 05 2023
(SageMath)
@CachedFunction
def a(n): # a = A100296
if (n<3): return (1, 1, 6)[n]
else: return 4*a(n-1) + 2*a(n-2) - a(n-3)
[a(n) for n in range(1, 41)] # G. C. Greubel, Feb 05 2023
CROSSREFS
Sequence in context: A295202 A346894 A094669 * A346818 A120758 A227914
KEYWORD
nonn,easy
AUTHOR
Gary W. Adamson, Nov 11 2004
EXTENSIONS
More terms from Colin Barker, May 25 2013
New name using g.f. from Joerg Arndt, Aug 31 2024
STATUS
approved