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,1,-2,1).
FORMULA
a(0)=1, a(1)=2, a(2)=3, a(3)=4, a(4)=7, a(5)=10, a(6)=13, a(7)=18, a(8)=23, a(n) = 2*a(n-1) - a(n-2) + a(n-7) - 2*a(n-8) + a(n-9). - Harvey P. Dale, Apr 26 2014
a(n) = floor( (2*n^2 + 3*n + 7 + 2*(floor((n-1)/7) - floor((n-2)/7)) )/7) = floor((2*n^2 +3*n +7 +2*A082784(n-1))/7). - G. C. Greubel, Sep 13 2019
MAPLE
seq(coeff(series((1+2*x^4+x^7)/((1-x)^2*(1-x^7)), x, n+1), x, n), n = 0..50); # G. C. Greubel, Sep 13 2019
MATHEMATICA
CoefficientList[Series[(1+2x^4+x^7)/(1-x)^2/(1-x^7), {x, 0, 50}], x] (* or *) LinearRecurrence[{2, -1, 0, 0, 0, 0, 1, -2, 1}, {1, 2, 3, 4, 7, 10, 13, 18, 23}, 50] (* Harvey P. Dale, Apr 26 2014 *)
PROG
(PARI) a(n)=floor((2*n^2+3*n+7+2*(n%7==1))/7) \\ Tani Akinari, Jun 01 2014
(Magma) R<x>:=PowerSeriesRing(Integers(), 50); Coefficients(R!( (1+2*x^4+x^7)/((1-x)^2*(1-x^7)) )); // G. C. Greubel, Sep 13 2019
(Sage)
def A008824_list(prec):
P.<x> = PowerSeriesRing(ZZ, prec)
return P((1+2*x^4+x^7)/((1-x)^2*(1-x^7))).list()
A008824_list(50) # G. C. Greubel, Sep 13 2019
(GAP) a:=[1, 2, 3, 4, 7, 10, 13, 18, 23];; for n in [10..50] do a[n]:=2*a[n-1]-a[n-2]+a[n-7]-2*a[n-8]+a[n-9]; od; a; # G. C. Greubel, Sep 13 2019
CROSSREFS
KEYWORD
nonn
AUTHOR
N. J. A. Sloane, Mar 15 1996
STATUS
approved