OFFSET
0,3
COMMENTS
LINKS
Vincenzo Librandi, Table of n, a(n) for n = 0..1000
Index entries for linear recurrences with constant coefficients, signature (0,0,2,0,0,-1).
FORMULA
a(3*k) = 2*k, a(3*k+1) = 1, a(3*k+2) = 2*(k+1).
a(n) = (1/9)*(4*n + 5 + (4*n-4)*cos((2*n+1)*Pi/3) + sqrt(3)*sin(2*(n-1)*Pi/3) - sqrt(3)*sin(4*(n-1)*Pi/3)). - Wesley Ivan Hurt, Sep 25 2017
From Vincenzo Librandi, Sep 27 2017: (Start)
G.f.: x*(1 +2*x +2*x^2 -x^3)/((1-x)^2*(1+x+x^2)^2).
a(n) = 2*a(n-3) - a(n-6) for n>8. (End)
EXAMPLE
First terms of r: 0 1 2 2/3 1 4/3 4/5 1 6/5 6/7 1 8/7 ...:
r(2) = (1+1)/(1+0) = 2, r(3) = (1+1)/(2+1) = 2/3, r(4) = (3+1)/(2+2) = 1,
r(5) = (1+3)/(1+2) = 4/3, r(6) = (3+1)/(4+1) = 4/5, ...
MATHEMATICA
Join[{0, 1}, LinearRecurrence[{0, 0, 2, 0, 0, -1}, {2, 2, 1, 4, 4, 1}, 100]] (* or *) CoefficientList[Series[x*(1+2*x+2*x^2-x^3)/((1-x)^2*(1+x+x^2)^2), {x, 0, 100}], x] (* Vincenzo Librandi, Sep 27 2017 *)
PROG
(Magma) I:=[0, 1, 2, 2, 1, 4, 4, 1]; [n le 8 select I[n] else 2*Self(n-3)-Self(n-6): n in [1..100]]; // Vincenzo Librandi, Sep 27 2017
(Sage)
def A110090_list(prec):
P.<x> = PowerSeriesRing(ZZ, prec)
return P( x*(1+2*x+2*x^2-x^3)/(1-x^3)^2 ).list()
A110090_list(100) # G. C. Greubel, Jun 16 2021
CROSSREFS
KEYWORD
nonn,easy,frac
AUTHOR
Reinhard Zumkeller, Jul 14 2005
STATUS
approved