OFFSET
0,4
LINKS
G. C. Greubel, Table of n, a(n) for n = 0..1000
Maria M. Gillespie, Kenneth G. Monks, and Kenneth M. Monks, Enumerating Anchored Permutations with Bounded Gaps, arXiv:1808.03573 [math.CO], 2018. Also Discrete Math.,343 (2020), #111957. See B(x).
Index entries for linear recurrences with constant coefficients, signature (2,-1,2,1,1,0,-1,-1).
FORMULA
G.f.: x*(1-x+x^2-x^3+x^4)/(1-2*x+x^2-2*x^3-x^4-x^5+x^7+x^8).
a(n) = 2*a(n-1) - a(n-2) + 2*a(n-3) + a(n-4) + a(n-5) - a(n-7) - a(n-8) for n>7. - Colin Barker, Oct 11 2020
MATHEMATICA
LinearRecurrence[{2, -1, 2, 1, 1, 0, -1, -1}, {0, 1, 1, 2, 4, 10, 22, 45}, 40] (* Harvey P. Dale, May 04 2023 *)
PROG
(PARI) concat(0, Vec((x^4-x^3+x^2-x+1)*x/(x^8+x^7-x^5-x^4-2*x^3+x^2-2*x+1)+ O(x^40))) \\ Michel Marcus, Oct 11 2020
(Magma)
R<x>:=PowerSeriesRing(Integers(), 50);
[0] cat Coefficients(R!( x*(1+x^5)/((1+x)*(1-2*x+x^2-2*x^3-x^4-x^5+x^7+x^8)) )); // G. C. Greubel, Sep 23 2024
(SageMath)
def A337654_list(prec):
P.<x> = PowerSeriesRing(ZZ, prec)
return P( x*(1+x^5)/((1+x)*(1-2*x+x^2-2*x^3-x^4-x^5+x^7+x^8)) ).list()
A337654_list(50) # G. C. Greubel, Sep 23 2024
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
N. J. A. Sloane, Sep 29 2020
STATUS
approved