OFFSET
0,7
LINKS
Index entries for linear recurrences with constant coefficients, signature (0,1,2,0,-2,-1,0,1).
FORMULA
a(3n+1) = A002620(n+2).
a(3n+2) = A002620(n+1).
a(3n+3) = A002620(n+2).
G.f.: x^3/((1+x)*(1+x+x^2)^2*(1-x)^3). - Alois P. Heinz, Mar 19 2019
a(n) = a(n-2) + 2*a(n-3) - 2*a(n-5) - a(n-6) + a(n-8). - G. C. Greubel, Apr 03 2019
a(n) = (6*n*(2 + n) + 8*(4 + 3*n)*cos(2*n*Pi/3) - 8*sqrt(3)*n*sin(2*n*Pi/3) - 5 - 27*(-1)^n)/216. - Stefano Spezia, Apr 21 2022
MATHEMATICA
LinearRecurrence[{0, 1, 2, 0, -2, -1, 0, 1}, {0, 0, 0, 1, 0, 1, 2, 1}, 80] (* G. C. Greubel, Apr 03 2019 *)
Table[(6n(2+n)-5-27(-1)^n+8(4+3n)Cos[2n Pi/3]-8Sqrt[3]n Sin[2n Pi/3])/216, {n, 0, 66}] (* Stefano Spezia, Apr 21 2022 *)
PROG
(PARI) my(x='x+O('x^80)); concat([0, 0, 0], Vec(x^3/((1-x^2)*(1-x^3)^2))) \\ G. C. Greubel, Apr 03 2019
(Magma) R<x>:=PowerSeriesRing(Integers(), 80); [0, 0, 0] cat Coefficients(R!( x^3/((1-x^2)*(1-x^3)^2) )); // G. C. Greubel, Apr 03 2019
(Sage) (x^3/((1-x^2)*(1-x^3)^2)).series(x, 80).coefficients(x, sparse=False) # G. C. Greubel, Apr 03 2019
(GAP) a:=[0, 0, 0, 1, 0, 1, 2, 1];; for n in [9..80] do a[n]:=a[n-2]+2*a[n-3] -2*a[n-5]-a[n-6]+a[n-8]; od; a; # G. C. Greubel, Apr 03 2019
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
Andrew Ivashenko, Mar 19 2019
EXTENSIONS
More terms from Alois P. Heinz, Mar 19 2019
STATUS
approved