OFFSET
0,7
LINKS
G. C. Greubel, Table of n, a(n) for n = 0..1000
FORMULA
G.f.: 1 - x + x^2 + x / (1 - x + x^2 + x / (1 - x + x^2 + x / ...)). (continued fraction convergence is one power series term per iteration).
G.f.: 1 + x^2 / (1 + x / (1 + x^2 / (1 + x / ...))). (continued fraction convergence is three power series terms per iteration).
a(n) = - A129509(n) if n>2.
HANKEL transform is period 8 sequence A112299(n+5) = [1, 1, -1, 0, 1, -1, -1, 0, ...].
HANKEL transform of a(n+1) is period 8 sequence -A112299(n+4) = [0, -1, -1, 1, 0, -1, 1, 1, ...].
D-finite with recurrence: n*a(n) +(2*n-3)*a(n-1) +3*(n-3)*a(n-2) +(-2*n+9)*a(n-3) +(n-6)*a(n-4)=0. - R. J. Mathar, Jan 25 2020
EXAMPLE
G.f. = 1 + x^2 - x^3 + x^4 - 2*x^6 + 4*x^7 - 3*x^8 - 5*x^9 + 20*x^10 + ...
MATHEMATICA
CoefficientList[Series[(1-x+x^2 +Sqrt[1+2*x+3*x^2-2*x^3+x^4])/2, {x, 0, 50}], x] (* G. C. Greubel, Aug 08 2018 *)
PROG
(PARI) {a(n) = if( n<0, 0, polcoeff( (1 - x + x^2 + sqrt(1 + 2*x + 3*x^2 - 2*x^3 + x^4 + x * O(x^n))) / 2, n))};
(PARI) {a(n) = my(A = 1 + O(x)); for(k=1, ceil(n / 3), A = 1 + x^2 / (1 + x / A)); polcoeff(A, n)};
(Magma) m:=50; R<x>:=PowerSeriesRing(Rationals(), m); Coefficients(R!((1-x+x^2 +Sqrt(1+2*x+3*x^2-2*x^3+x^4))/2)); // G. C. Greubel, Aug 08 2018
CROSSREFS
KEYWORD
sign
AUTHOR
Michael Somos, Mar 19 2014
STATUS
approved