OFFSET
0,2
LINKS
G. C. Greubel, 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,0,1,-2,1).
FORMULA
a(n) = floor((2*n^2 + 3*n + 9)/9) + ((n-3) mod 9) - ((n-1) mod 9) + 2)/9. - G. C. Greubel, Sep 13 2019
a(n) = 1 + floor(n*(2*n + 3)/9) + [mod(n-1,9)<2], where [] is the Iverson bracket. - Michel Marcus, Sep 14 2019
EXAMPLE
G.f. = 1 + 2*x + 3*x^2 + 4*x^3 + 5*x^4 + 8*x^5 + 11*x^6 + 14*x^7 + 17*x^8 + ...
MAPLE
seq(coeff(series((1+2*x^5+x^9)/((1-x)^2*(1-x^9)), x, n+1), x, n), n = 0..50); # G. C. Greubel, Sep 13 2019
MATHEMATICA
CoefficientList[Series[(1+2*x^5+x^9)/((1-x)^2*(1-x^9)), {x, 0, 50}], x] (* G. C. Greubel, Sep 13 2019 *)
PROG
(PARI) a(n)=floor((2*n^2+3*n)/9)+1+((n-1)%9<2) \\ Tani Akinari, Jun 01 2014
(PARI) {a(n) = ((n + 1) * (2*n + 1) + 4*(2 + (n%9%4>0))) \ 9}; /* Michael Somos, Jun 01 2014 */
(Magma) R<x>:=PowerSeriesRing(Integers(), 50); Coefficients(R!( (1+2*x^5+x^9)/((1-x)^2*(1-x^9)) )); // G. C. Greubel, Sep 13 2019
(Sage)
def A008825_list(prec):
P.<x> = PowerSeriesRing(ZZ, prec)
return P((1+2*x^5+x^9)/((1-x)^2*(1-x^9))).list()
A008825_list(50) # G. C. Greubel, Sep 13 2019
(GAP) a:=[1, 2, 3, 4, 5, 8, 11, 14, 17, 22, 27];; for n in [12..50] do a[n]:= 2*a[n-1]-a[n-2] +a[n-9]-2*a[n-10]+a[n-11]; od; a; # G. C. Greubel, Sep 13 2019
CROSSREFS
KEYWORD
nonn
AUTHOR
STATUS
approved