On Sun, July 8, 2007 at 10:25PM, Barton Willis wrote:
> (%i4) (3^(i1+1)-2*2^i1)*x^i1;
> (%o4) (3^(i1+1)-2^(i1+1))*x^i1
what's happening inside the powerseries function is something like:
(%i5) (3^(i1+1) + -2*2^i1)*x^i1;
(%o5) (3^(i1+1)-2*2^i1)*x^i1
I tried using addn / muln in the powerseries function, but didn't
get any different results. I was able to get the tests to pass by
mimicking the way the exps are built up in the code:
/* two simple roots */
powerseries((1)/((1-2*x)*(1-3*x)), x, 0);
'sum((3^(i1+1)+(-2*2^i1))*x^i1,i1,0,inf);
/* 1 1 2 2 4 4 8 8 */
powerseries((1+x)/(1-2*x^2), x, 0);
'sum( (-1*(1/-(1/sqrt(2)))*(1/sqrt(2)-1)*(1/-(4/sqrt(2)))*(1/-(1/sqrt(2)))^i3 +
-1*(1/(1/sqrt(2)))*(-(1/sqrt(2))-1)*(1/(4/sqrt(2)))*(1/(1/sqrt(2)))^i3 ) * x\
^i3,i3,0,inf);
/* gcd of exps is two */
powerseries((1-x^2)/(1-4*x^2+x^4), x, 0);
'sum((-1*(1/(2-sqrt(3)))*(sqrt(3)-1)*(1/(2*(2-sqrt(3))-4))*(1/(2-sqrt(3)))^i8 +
-1*(1/(sqrt(3)+2))*(-sqrt(3)-1)*(1/(2*(sqrt(3)+2)-4))*(1/(sqrt(3)+2))^i8 )*x^(2*i8),
i8, 0, inf);