login
A129441
Expansion of g.f. (1-x^2-x^3)/((1+x+x^2)*(1-2*x-x^2-x^3+x^4)).
3
1, 1, 2, 7, 16, 39, 100, 248, 618, 1546, 3858, 9631, 24049, 60041, 149903, 374266, 934427, 2332981, 5824753, 14542648, 36308602, 90651625, 226329747, 565077072, 1410826915, 3522409024, 8794392287, 21956943442, 54819861280, 136868649264
OFFSET
0,3
FORMULA
a(n) = a(n-1) +2*a(n-2) +4*a(n-3) +a(n-4) -a(n-6).
MATHEMATICA
LinearRecurrence[{1, 2, 4, 1, 0, -1}, {1, 1, 2, 7, 16, 39}, 40] (* Harvey P. Dale, Nov 26 2015 *)
PROG
(Magma) R<x>:=PowerSeriesRing(Integers(), 40); Coefficients(R!( (1-x^2-x^3)/((1+x+x^2)*(1-2*x-x^2-x^3+x^4)) )); // G. C. Greubel, Feb 06 2024
(SageMath)
def A129441_list(prec):
P.<x> = PowerSeriesRing(ZZ, prec)
return P( (1-x^2-x^3)/((1+x+x^2)*(1-2*x-x^2-x^3+x^4)) ).list()
A129441_list(40) # G. C. Greubel, Feb 06 2024
(PARI) a(n)=([0, 1, 0, 0, 0, 0; 0, 0, 1, 0, 0, 0; 0, 0, 0, 1, 0, 0; 0, 0, 0, 0, 1, 0; 0, 0, 0, 0, 0, 1; -1, 0, 1, 4, 2, 1]^n*[1; 1; 2; 7; 16; 39])[1, 1] \\ Charles R Greathouse IV, May 27 2026
CROSSREFS
Sequence in context: A293378 A377728 A041887 * A093971 A065497 A131727
KEYWORD
nonn,less,easy
AUTHOR
Roger L. Bagula, Jun 08 2007
EXTENSIONS
Definition simplified - the Assoc. Eds of the OEIS, Mar 28 2010
Offset corrected by G. C. Greubel, Feb 06 2024
STATUS
approved