OFFSET
0,2
LINKS
Vincenzo Librandi, Table of n, a(n) for n = 0..1000
Index entries for linear recurrences with constant coefficients, signature (2,-1,0,0,0,0,0,1,-2,1).
FORMULA
G.f.: (1 + x^8)/((1 - x)^3*(1 + x)*(1 + x^2)*(1 + x^4)).
a(n) = floor( (n*(n+2) + 14 + 4*((n mod 4) - 1)*(-1)^floor(n/4))/8 ). - Tani Akinari, Jul 25 2013
a(n) = 2*a(n-1) - a(n-2) + a(n-8) - 2*a(n-9) + a(n-10). - Vincenzo Librandi, May 14 2019
MAPLE
seq(coeff(series((1+x^8)/((1-x)^2*(1-x^8)), x, n+1), x, n), n = 0..50); # G. C. Greubel, Sep 12 2019
MATHEMATICA
CoefficientList[Series[(1+x^8)/(1-x)^2/(1-x^8), {x, 0, 50}], x] (* or *) LinearRecurrence[{2, -1, 0, 0, 0, 0, 0, 1, -2, 1}, {1, 2, 3, 4, 5, 6, 7, 8, 11, 14}, 50] (* Harvey P. Dale, Dec 17 2016 *)
PROG
(PARI) a(n)=(n*(n+2)+14+4*(n%4-1)*(-1)^(n\4))\8 \\ Tani Akinari, Jul 25 2013
(Magma) I:=[1, 2, 3, 4, 5, 6, 7, 8, 11, 14]; [n le 10 select I[n] else 2*Self(n-1) -Self(n-2)+Self(n-8)-2*Self(n-9)+Self(n-10): n in [1..50]]; // Vincenzo Librandi, May 14 2019
(Sage)
def A008815_list(prec):
P.<x> = PowerSeriesRing(ZZ, prec)
return P((1+x^8)/((1-x)^2*(1-x^8))).list()
A008815_list(50) # G. C. Greubel, Sep 12 2019
(GAP) a:=[1, 2, 3, 4, 5, 6, 7, 8, 11, 14];; for n in [11..50] do a[n]:=2*a[n-1] -a[n-2]+a[n-8]-2*a[n-9]+a[n-10]; od; a; # G. C. Greubel, Sep 12 2019
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
STATUS
approved