Kurt Foster on Mon, 23 Jul 2018 14:50:34 +0200

[Date Prev] [Date Next] [Thread Prev] [Thread Next] [Date Index] [Thread Index]

Re: generating function solution to poly

On Jul 21, 2018, at 2:38 AM, Kevin Ryde wrote:

I have a generating function (and more terms too)

g = x^2 + x^3 + x^4 + 3*x^5 + 6*x^6 + 12*x^7 + 29*x^8 + 67*x^9 + O(x^10);

which satisfies a cubic

   (1+x)*g^3 - 2*g^2 + (1-x+2*x^2)*g - x^2 == 0

Is there an easy or good way to have gp solve that for series g?

I know how to work upwards to get g term by term (after deciding lowest should be 0), but maybe gp already has it. I wondered only for interest
or generality though, since this one comes from recurrences which are
easy to calculate.  I attempted serreverse() without joy (change
variables to solve in x, but I may have confused myself).

On Jul 22, 2018, at 2:15 AM, Peter Pein wrote:

Hi Kevin,

I'm just curious:  are you sure the coefficients in g are correct?

starting Bill Allombert's suggestion to iterate via Newton but starting with just X^2+O(X^3) gives another sequence for g and a difference for
coeffs of x^7 and higher powers

? P=substvec((1+x)*g^3-2*g^2+(1+x+2*x^2)*g-x^2,[x,g],[X,y])
%1 = (X + 1)*y^3 - 2*y^2 + (2*X^2 + X + 1)*y - X^2

Different problem, different solution. Compare coefficients of y, 1-x +2*x^2 and 2*X^2 + X + 1. Never mind the change of variable name or order of terms. A minus sign has ben changed to a plus sign.

Take it from a holder of a Black Belt of transfinite degree in making typos -- copy-paste is the way to go in transcribing algebraic expressions.