OFFSET
0,4
LINKS
Robert Israel, Table of n, a(n) for n = 0..220
EXAMPLE
G.f.: A(x) = 1 + x + x^2 + 2*x^3 + 4*x^4 + 12*x^5 + 35*x^6 + 133*x^7 +...
Related expansion:
x/A(-x) = x + x^2 + x^4 - x^5 + 6*x^6 - 14*x^7 + 72*x^8 - 250*x^9 + 1338*x^10 +..
MAPLE
eq:= 1 - A(x) + x*A(x/A(-x)):
AA[0]:= 1: c[0]:= 1:
for n from 1 to 50 do
S:= series(eval(eq, A = unapply(AA[n-1]+c[n]*x^n, x)), x, n+1);
c[n]:= solve(convert(S, polynom), c[n]);
AA[n]:= AA[n-1]+c[n]*x^n;
od:
seq(c[n], n=0..50); # Robert Israel, Aug 02 2017
MATHEMATICA
nmax = 26; sol = {a[0] -> 1};
Do[A[x_] = Sum[a[k] x^k, {k, 0, n}] /. sol; eq = CoefficientList[A[x] - (1 + x*A[x/A[-x]]) + O[x]^(n + 1), x] == 0 /. sol; sol = sol ~Join~ Solve[eq][[1]], {n, 1, nmax}];
sol /. HoldPattern[a[n_] -> k_] :> Set[a[n], k];
a /@ Range[0, nmax] (* Jean-François Alcover, Nov 01 2019 *)
PROG
(PARI) {a(n)=local(A=1+x+x*O(x^n)); for(i=1, n, A=1+x*subst(A, x, x/subst(A, x, -x+x*O(x^n)))); polcoeff(A, n)}
for(n=0, 25, print1(a(n), ", "))
CROSSREFS
KEYWORD
nonn
AUTHOR
Paul D. Hanna, Jun 06 2012
STATUS
approved