OFFSET
0,3
COMMENTS
The sequence is a quasi-polynomial sequence.
Given a sequence of Laurent polynomials defined by b(n) = (b(n-2)^2 - b(n-1)*b(n-3) * 2/x) / b(n-4), b(-2) = x, b(-4) = -b(-3) = -b(-1) = 1. Then the denominator of b(n) is x^a(n).
LINKS
G. C. Greubel, Table of n, a(n) for n = 0..2500
Index entries for linear recurrences with constant coefficients, signature (2,-1,1,-2,1).
FORMULA
0 = a(n)*(a(n+2) + a(n+3)) + a(n+1)*(-2*a(n+2) - a(n+3) + a(n+4)) + a(n+2)*(a(n+2) - 2*a(n+3) + a(n+4)) for all n in Z.
G.f.: (1 - x + 2*x^2 - x^3) / ((1 - x)^2 * (1 - x^3)).
Second difference is period 3 sequence [2, 0, -1, ...].
a(n) = 2*a(n-3) + a(n-6) + 3 = 2*a(n-1) - a(n-2) + a(n-3) - 2*a(n-4) + a(n-5).
a(-6-n) = A236337(n).
From Peter Bala, Feb 11 2019: (Start)
a(3*n) = (1/2)*(n + 1)*(3*n + 2);
a(3*n+1) = (1/2)*(n + 1)*(3*n + 4) - 1;
a(3*n+2) = (1/2)*(n + 1)*(3*n + 6). (End)
EXAMPLE
G.f. = 1 + x + 3*x^2 + 5*x^3 + 6*x^4 + 9*x^5 + 12*x^6 + 14*x^7 + 18*x^8 + ...
MAPLE
seq(coeff(series((1-x+2*x^2-x^3)/((1-x)^2*(1-x^3)), x, n+1), x, n), n = 0 .. 60); # Muniru A Asiru, Feb 12 2019
MATHEMATICA
CoefficientList[Series[(1-x+2*x^2-x^3)/((1-x)^2*(1-x^3)), {x, 0, 60}], x] (* G. C. Greubel, Aug 07 2018 *)
PROG
(PARI) {a(n) = (n * (n+5) + [6, 0, 4][n%3 + 1]) / 6};
(PARI) {a(n) = if( n<0, polcoeff( x^2 * (-1 + 2*x - x^2 + x^3) / ((1 - x)^2 * (1 - x^3)) + x * O(x^-n), -n), polcoeff( (1 - x + 2*x^2 - x^3) / ((1 - x)^2 * (1 - x^3)) + x * O(x^n), n))};
(Magma) m:=60; R<x>:=PowerSeriesRing(Integers(), m); Coefficients(R!((1-x+2*x^2-x^3)/((1-x)^2*(1-x^3)))); // G. C. Greubel, Aug 07 2018
(Sage) ((1-x+2*x^2-x^3)/((1-x)^2*(1-x^3))).series(x, 60).coefficients(x, sparse=False) # G. C. Greubel, Feb 12 2019
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
Michael Somos, Jan 22 2014
STATUS
approved