OFFSET
0,3
COMMENTS
With 1 prepended, and up to sign this is the q-deformation of 12/5. See Leclere and Morier-Genoud. - Michel Marcus, Jul 01 2021
LINKS
G. C. Greubel, Table of n, a(n) for n = 0..1000
Ludivine Leclere and Sophie Morier-Genoud, q-deformations of the modular group and of the real quadratic irrational numbers, arXiv:2101.02953 [math.NT], 2021. See Example 2.7 p. 6.
Index entries for linear recurrences with constant coefficients, signature (1,-2,1).
FORMULA
a(n) = a(n-1) - 2*a(n-2) + a(n-3). - Michael Somos, Sep 18 2012
a(n) = -A000931(-2*n - 1). - Michael Somos, Sep 18 2012
G.f.: (1+x)/x^3 - 1/( Q(0) - x )/x^3 where Q(k) = 1 - x^2/(x^2*k - 1 )/Q(k+1) ; (recursively defined continued fraction). - Sergei N. Gladkovskii, Feb 23 2013
a(n) = (-1)^(n-1)*(A077979(n) + A077979(n-1)) = A077954(n) - A077954(n-1). - G. C. Greubel, Jun 29 2019
EXAMPLE
G.f. = 1 - 2*x^2 - x^3 + 3*x^4 + 3*x^5 - 4*x^6 - 7*x^7 + 4*x^8 + ...
MATHEMATICA
CoefficientList[Series[(1-x)/(1-x+2x^2-x^3), {x, 0, 50}], x] (* or *) LinearRecurrence[{1, -2, 1}, {1, 0, -2}, 51] (* Harvey P. Dale, Feb 18 2013 *)
PROG
(PARI) {a(n) = if( n<0, polcoeff( (1 - 2*x) / (1 - 2*x + x^2 - x^3) + x * O(x^-n), -n), polcoeff( (1 - x) / (1 - x + 2*x^2 - x^3) + x * O(x^n), n))} /* Michael Somos, Sep 18 2012 */
(Magma) R<x>:=PowerSeriesRing(Integers(), 50); Coefficients(R!( (1-x)/(1-x+2*x^2-x^3) )); // G. C. Greubel, Jun 29 2019
(Sage) ((1-x)/(1-x+2*x^2-x^3)).series(x, 50).coefficients(x, sparse=False) # G. C. Greubel, Jun 29 2019
(GAP) a:=[1, 0, -2];; for n in [4..50] do a[n]:=a[n-1]-2*a[n-2]+a[n-3]; od; a; # G. C. Greubel, Jun 29 2019
CROSSREFS
KEYWORD
sign,easy
AUTHOR
N. J. A. Sloane, Nov 17 2002
STATUS
approved