>    restart; read `c:/Users/Asus/Google Drive/Aek/Pile Game2/Pile2.txt`;

>    read `c:/Users/Asus/Google Drive/Guess.txt`;

>    #Section 4.1, G_{n,s}(x) for {1,-u}

>    # u=2

>    seq(print(n,[seq(GenG(n,s,-2,p,q,x),s=0..n)]),n=1..7);

1, [-x*p/(-1+q*x), 1]

2, [-x^2*p^2/(-1+q*x+q*x^2*p), x*p/(-1+q*x+q*x^2*p)*(-1+q*x), 1]

3, [-x^3*p^3/(-1+q*x+q*x^2*p+q*x^3*p^2), x^2*p^2/(-1+q*x+q*x^2*p+q*x^3*p^2)*(-1+q*x), x*p/(-1+q*x+q*x^2*p+q*x^3*p^2)*(-1+q*x+q*x^2*p), 1]

4, [x^4*p^4/(1-q*x-q*x^2*p-2*q*x^3*p^2+q^2*x^4*p^2), -x^3*p^3/(1-q*x-q*x^2*p-2*q*x^3*p^2+q^2*x^4*p^2)*(-1+q*x), -x^2*p^2/(1-q*x-q*x^2*p-2*q*x^3*p^2+q^2*x^4*p^2)*(-1+q*x+q*x^2*p), -x*p/(1-q*x-q*x^2*p-2*...
4, [x^4*p^4/(1-q*x-q*x^2*p-2*q*x^3*p^2+q^2*x^4*p^2), -x^3*p^3/(1-q*x-q*x^2*p-2*q*x^3*p^2+q^2*x^4*p^2)*(-1+q*x), -x^2*p^2/(1-q*x-q*x^2*p-2*q*x^3*p^2+q^2*x^4*p^2)*(-1+q*x+q*x^2*p), -x*p/(1-q*x-q*x^2*p-2*...

5, [x^5*p^5/(1-q*x-q*x^2*p-3*q*x^3*p^2+2*q^2*x^4*p^2+q^2*x^5*p^3), -x^4*p^4/(1-q*x-q*x^2*p-3*q*x^3*p^2+2*q^2*x^4*p^2+q^2*x^5*p^3)*(-1+q*x), -x^3*p^3/(1-q*x-q*x^2*p-3*q*x^3*p^2+2*q^2*x^4*p^2+q^2*x^5*p^3...
5, [x^5*p^5/(1-q*x-q*x^2*p-3*q*x^3*p^2+2*q^2*x^4*p^2+q^2*x^5*p^3), -x^4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