CoCalc Public Files18.783 Lecture 6 Division polynomials.ipynb
Author: Andrew Sutherland
Views : 88
Description: Code to symbolically compute division polynomials, both directly from the group law, and via recurrences.
Compute Environment: Ubuntu 20.04 (Default)
In [1]:
R.<x,y,A,B>=PolynomialRing(Rationals())

def reduce_poly_once(f):
g = R(0)
for t in f.monomials():
if t.mod(y^2) == 0:
g += f.monomial_coefficient(t)*R(t/y^2*(x^3+A*x+B))
else:
g += f.monomial_coefficient(t)*t
return g

def reduce_poly(f):
while f.degrees()[1] > 1: f = reduce_poly_once(f)
return f

def reduce_point(P):
return (reduce_poly(P[0]),reduce_poly(P[1]),reduce_poly(P[2]))

def dbl(P):
x1= P[0]; y1=P[1]; z1=P[2]
x3=x1^4-2*A*x1^2*z1^4-8*B*x1*z1^6+A^2*z1^8
y3=x1^6+5*A*x1^4*z1^4+20*B*x1^3*z1^6-5*A^2*x1^2*z1^8-4*A*B*x1*z1^10-(A^3+8*B^2)*z1^12
z3=2*y1*z1
return reduce_point((x3,y3,z3))

if compare_point(P,Q): return dbl(P)
x1=P[0]; y1=P[1]; z1=P[2]; x2=Q[0]; y2=Q[1]; z2=Q[2]
x3 = A*(x1*z2^2+x2*z1^2)*z1^2*z2^2 + 2*B*z1^4*z2^4 + x1^2*x2*z2^2+x1*x2^2*z1^2-2*y1*y2*z1*z2
y3 =(A*x2*z2+B*z2^3)*y2*z1^6 - (A*x1*z1+B*z1^3)*y1*z2^6+2*(x2^3*y1*z1^3 - x1^3*y2*z2^3) + 3*x1*x2*z1*z2*(x1*y2*z1 - x2*y1*z2)  + 3*y1*y2*(y1*z2^3 - y2*z1^3)
z3 = x1*z2^2-x2*z1^2
return reduce_point((x3,y3,z3))

def compare_point(P,Q):
return (P[0]*Q[2]^2 == Q[0]*P[2]^2 and P[1]*Q[2]^3 == Q[1]*P[2]^3)

In [2]:
# compute the first 7 division polynomials using the group law
# NB: to avoid introducing extra factors compute P[2m+1] as P[m]+P[m+1] and P[2m]=P[m]+P[m]
# It will also work with arbitrary additions, but this may require removing common factors from the coordinates
# A more complicated version of reduce_point that does this is provided below.
P = [(R(0),R(1),R(0))]                   # point at infinity
P.append((R(x),R(y),R(1)))               # generic point P
P.append(dbl(P[1]))        # 2P = P + P
P.append(add(P[2],P[1]))   # 3P = 2P + P
P.append(dbl(P[2]))        # 4P = 2P + 2P
P.append(add(P[2],P[3]))   # 5P = 2P + 3P
P.append(dbl(P[3]))        # 6P = 3P + 3P
P.append(add(P[3],P[4]))   # 7P = 3P + 4P

In [4]:
for n in range(1,8): print("%d, %s, %s, %s"%(n,P[n][0], P[n][1], P[n][2]))

1, x, y, 1 2, x^4 - 2*x^2*A + A^2 - 8*x*B, x^6 + 5*x^4*A - 5*x^2*A^2 + 20*x^3*B - A^3 - 4*x*A*B - 8*B^2, 2*y 3, x^9 - 12*x^7*A + 30*x^5*A^2 - 96*x^6*B + 36*x^3*A^3 - 24*x^4*A*B + 9*x*A^4 + 48*x^2*A^2*B + 48*x^3*B^2 + 8*A^3*B + 96*x*A*B^2 + 64*B^3, -x^12*y - 22*x^10*y*A + 165*x^8*y*A^2 - 220*x^9*y*B + 92*x^6*y*A^3 + 528*x^7*y*A*B + 185*x^4*y*A^4 - 264*x^5*y*A^2*B + 1776*x^6*y*B^2 + 90*x^2*y*A^5 + 80*x^3*y*A^3*B + 960*x^4*y*A*B^2 + 3*y*A^6 + 132*x*y*A^4*B + 624*x^2*y*A^2*B^2 + 320*x^3*y*B^3 + 96*y*A^3*B^2 + 896*x*y*A*B^3 + 512*y*B^4, -3*x^4 - 6*x^2*A + A^2 - 12*x*B 4, x^16 - 40*x^14*A + 348*x^12*A^2 - 544*x^13*B + 1000*x^10*A^3 + 128*x^11*A*B + 1478*x^8*A^4 + 1760*x^9*A^2*B + 2944*x^10*B^2 + 1000*x^6*A^5 + 3584*x^7*A^3*B + 9696*x^8*A*B^2 + 348*x^4*A^6 + 1952*x^5*A^4*B + 14208*x^6*A^2*B^2 + 8704*x^7*B^3 - 40*x^2*A^7 + 1408*x^3*A^5*B + 2368*x^4*A^3*B^2 + 26624*x^5*A*B^3 + A^8 - 96*x*A^6*B + 1536*x^2*A^4*B^2 + 7680*x^3*A^2*B^3 + 15872*x^4*B^4 - 32*A^5*B^2 + 11264*x^2*A*B^4 - 256*A^2*B^4 + 4096*x*B^5, x^24 + 68*x^22*A - 1694*x^20*A^2 + 1232*x^21*B - 3276*x^18*A^3 - 9856*x^19*A*B - 19601*x^16*A^4 + 10032*x^17*A^2*B - 58688*x^18*B^2 - 63352*x^14*A^5 + 26368*x^15*A^3*B - 150960*x^16*A*B^2 - 86436*x^12*A^6 - 140000*x^13*A^4*B - 278400*x^14*A^2*B^2 - 49408*x^15*B^3 - 63352*x^10*A^7 - 290304*x^11*A^5*B - 804160*x^12*A^3*B^2 - 492800*x^13*A*B^3 - 19601*x^8*A^8 - 293536*x^9*A^6*B - 894720*x^10*A^4*B^2 - 2248960*x^11*A^2*B^3 - 439040*x^12*B^4 - 3276*x^6*A^9 - 87808*x^7*A^7*B - 848928*x^8*A^5*B^2 - 2213120*x^9*A^3*B^3 - 3591680*x^10*A*B^4 - 1694*x^4*A^10 + 4368*x^5*A^8*B - 318080*x^6*A^6*B^2 - 1391360*x^7*A^4*B^3 - 4753920*x^8*A^2*B^4 - 2111488*x^9*B^5 + 68*x^2*A^11 - 7040*x^3*A^9*B + 20160*x^4*A^7*B^2 - 517888*x^5*A^5*B^3 - 2293760*x^6*A^3*B^4 - 5320704*x^7*A*B^5 + A^12 + 112*x*A^10*B - 8640*x^2*A^8*B^2 - 29440*x^3*A^6*B^3 - 224000*x^4*A^4*B^4 - 3698688*x^5*A^2*B^5 - 1949696*x^6*B^6 + 80*A^9*B^2 - 3840*x*A^7*B^3 - 84480*x^2*A^5*B^4 - 4096*x^3*A^3*B^5 - 2953216*x^4*A*B^6 - 55296*x*A^4*B^5 - 155648*x^2*A^2*B^6 - 851968*x^3*B^7 - 8192*A^3*B^6 - 163840*x*A*B^7 - 32768*B^8, 4*x^6*y + 20*x^4*y*A - 20*x^2*y*A^2 + 80*x^3*y*B - 4*y*A^3 - 16*x*y*A*B - 32*y*B^2 5, x^25 - 100*x^23*A + 2250*x^21*A^2 - 2080*x^22*B + 11900*x^19*A^3 + 4664*x^20*A*B + 45415*x^17*A^4 + 28880*x^18*A^2*B + 50320*x^19*B^2 + 85624*x^15*A^5 + 163000*x^16*A^3*B + 301920*x^17*A*B^2 + 110060*x^13*A^6 + 240640*x^14*A^4*B + 1172928*x^15*A^2*B^2 + 367040*x^16*B^3 + 47000*x^11*A^7 + 558960*x^12*A^5*B + 888320*x^13*A^3*B^2 + 3278080*x^14*A*B^3 - 27425*x^9*A^8 + 504672*x^10*A^6*B + 931680*x^11*A^4*B^2 + 4373760*x^12*A^2*B^3 + 2924800*x^13*B^4 - 16020*x^7*A^9 - 60880*x^8*A^7*B + 1420480*x^9*A^5*B^2 + 2282240*x^10*A^3*B^3 + 8104960*x^11*A*B^4 + 2794*x^5*A^10 - 130400*x^6*A^8*B + 157120*x^7*A^6*B^2 + 1436800*x^8*A^4*B^3 + 7705600*x^9*A^2*B^4 + 3491840*x^10*B^5 + 620*x^3*A^11 + 1880*x^4*A^9*B - 275712*x^5*A^7*B^2 - 247040*x^6*A^5*B^3 + 2944000*x^7*A^3*B^4 + 7987200*x^8*A*B^5 + 25*x*A^12 + 1360*x^2*A^10*B + 4240*x^3*A^8*B^2 - 362240*x^4*A^6*B^3 - 1483520*x^5*A^4*B^4 + 4915200*x^6*A^2*B^5 + 2805760*x^7*B^6 + 24*A^11*B + 1760*x*A^9*B^2 + 11520*x^2*A^7*B^3 - 307200*x^3*A^5*B^4 - 2406400*x^4*A^3*B^5 + 3842048*x^5*A*B^6 + 960*A^8*B^3 + 17920*x*A^6*B^4 - 153600*x^2*A^4*B^5 - 2088960*x^3*A^2*B^6 + 1064960*x^4*B^7 + 10240*A^5*B^5 - 1146880*x^2*A*B^7 + 32768*A^2*B^7 - 327680*x*B^8, x^36*y + 162*x^34*y*A - 10659*x^32*y*A^2 + 4692*x^33*y*B - 17680*x^30*y*A^3 - 107712*x^31*y*A*B - 636140*x^28*y*A^4 + 556512*x^29*y*A^2*B - 884544*x^30*y*B^2 - 4387464*x^26*y*A^5 + 677056*x^27*y*A^3*B - 2780928*x^28*y*A*B^2 - 13183308*x^24*y*A^6 - 17228880*x^25*y*A^4*B - 20537280*x^26*y*A^2*B^2 + 1880320*x^27*y*B^3 - 25646064*x^22*y*A^7 - 64421568*x^23*y*A^5*B - 150297984*x^24*y*A^3*B^2 - 51922944*x^25*y*A*B^3 - 25306290*x^20*y*A^8 - 184798176*x^21*y*A^6*B - 321867072*x^22*y*A^4*B^2 - 621909504*x^23*y*A^2*B^3 - 94222080*x^24*y*B^4 - 18498420*x^18*y*A^9 - 182074176*x^19*y*A^7*B - 932327424*x^20*y*A^5*B^2 - 1202617344*x^21*y*A^3*B^3 - 1621002240*x^22*y*A*B^4 - 21703866*x^16*y*A^10 - 40481928*x^17*y*A^8*B - 1191254976*x^18*y*A^6*B^2 - 2559863040*x^19*y*A^4*B^3 - 4509453312*x^20*y*A^2*B^4 - 1437769728*x^21*y*B^5 - 21670512*x^14*y*A^11 - 27662400*x^15*y*A^9*B - 536307840*x^16*y*A^7*B^2 - 3179197440*x^17*y*A^5*B^3 - 8099312640*x^18*y*A^3*B^4 - 7632285696*x^19*y*A*B^5 - 6610076*x^12*y*A^12 - 140843232*x^13*y*A^10*B + 101454912*x^14*y*A^8*B^2 - 2536363008*x^15*y*A^6*B^3 - 5723815680*x^16*y*A^4*B^4 - 20244584448*x^17*y*A^2*B^5 - 3534606336*x^18*y*B^6 + 2411000*x^10*y*A^13 - 91460544*x^11*y*A^11*B - 247137024*x^12*y*A^9*B^2 - 808531968*x^13*y*A^7*B^3 - 2914099200*x^14*y*A^5*B^4 - 16995778560*x^15*y*A^3*B^5 - 21804982272*x^16*y*A*B^6 + 983460*x^8*y*A^14 + 3901616*x^9*y*A^12*B - 336004416*x^10*y*A^10*B^2 - 618893568*x^11*y*A^8*B^3 - 2617466880*x^12*y*A^6*B^4 - 2851430400*x^13*y*A^4*B^5 - 30747820032*x^14*y*A^2*B^6 - 8883929088*x^15*y*B^7 + 43632*x^6*y*A^15 + 5757888*x^7*y*A^13*B - 4558464*x^8*y*A^11*B^2 - 724111360*x^9*y*A^9*B^3 - 2336937984*x^10*y*A^7*B^4 - 2465390592*x^11*y*A^5*B^5 - 9487220736*x^12*y*A^3*B^6 - 25508708352*x^13*y*A*B^7 + 13369*x^4*y*A^16 - 41760*x^5*y*A^14*B + 18446400*x^6*y*A^12*B^2 - 8517120*x^7*y*A^10*B^3 - 1189704960*x^8*y*A^8*B^4 - 5621059584*x^9*y*A^6*B^5 - 1191321600*x^10*y*A^4*B^6 - 16594698240*x^11*y*A^2*B^7 - 6868500480*x^12*y*B^8 + 1122*x^2*y*A^17 + 23104*x^3*y*A^15*B + 127488*x^4*y*A^13*B^2 + 28750848*x^5*y*A^11*B^3 + 101713920*x^6*y*A^9*B^4 - 1808105472*x^7*y*A^7*B^5 - 8285405184*x^8*y*A^5*B^6 - 4022992896*x^9*y*A^3*B^7 - 9923198976*x^10*y*A*B^8 + 5*y*A^18 + 2004*x*y*A^16*B + 49344*x^2*y*A^14*B^2 + 305408*x^3*y*A^12*B^3 + 29445120*x^4*y*A^10*B^4 + 273530880*x^5*y*A^8*B^5 - 1746468864*x^6*y*A^6*B^6 - 10423369728*x^7*y*A^4*B^7 - 5163319296*x^8*y*A^2*B^8 - 1853358080*x^9*y*B^9 + 1152*y*A^15*B^2 + 68608*x*y*A^13*B^3 + 568320*x^2*y*A^11*B^4 + 19845120*x^3*y*A^9*B^5 + 342589440*x^4*y*A^7*B^6 - 665321472*x^5*y*A^5*B^7 - 10914103296*x^6*y*A^3*B^8 - 2548039680*x^7*y*A*B^9 + 35584*y*A^12*B^4 + 829440*x*y*A^10*B^5 + 9400320*x^2*y*A^8*B^6 + 246743040*x^3*y*A^6*B^7 + 448266240*x^4*y*A^4*B^8 - 8024752128*x^5*y*A^2*B^9 - 497025024*x^6*y*B^10 + 450560*y*A^9*B^6 + 5898240*x*y*A^7*B^7 + 100270080*x^2*y*A^5*B^8 + 697303040*x^3*y*A^3*B^9 - 3605004288*x^4*y*A*B^10 + 2949120*y*A^6*B^8 + 30146560*x*y*A^4*B^9 + 336592896*x^2*y*A^2*B^10 - 742391808*x^3*y*B^11 + 10485760*y*A^3*B^10 + 75497472*x*y*A*B^11 + 16777216*y*B^12, 5*x^12 + 62*x^10*A - 105*x^8*A^2 + 380*x^9*B - 300*x^6*A^3 + 240*x^7*A*B - 125*x^4*A^4 - 696*x^5*A^2*B - 240*x^6*B^2 - 50*x^2*A^5 - 80*x^3*A^3*B - 1920*x^4*A*B^2 + A^6 - 100*x*A^4*B - 240*x^2*A^2*B^2 - 1600*x^3*B^3 - 32*A^3*B^2 - 640*x*A*B^3 - 256*B^4 6, x^36 - 210*x^34*A + 10137*x^32*A^2 - 6216*x^33*B + 88272*x^30*A^3 + 42240*x^31*A*B + 714996*x^28*A^4 + 269760*x^29*A^2*B + 475392*x^30*B^2 + 2606472*x^26*A^5 + 3688448*x^27*A^3*B + 4805952*x^28*A*B^2 + 7456644*x^24*A^6 + 8489376*x^25*A^4*B + 39484800*x^26*A^2*B^2 + 8163328*x^27*B^3 + 7190448*x^22*A^7 + 55653120*x^23*A^5*B + 41125824*x^24*A^3*B^2 + 160694784*x^25*A*B^3 - 8116242*x^20*A^8 + 115594560*x^21*A^6*B + 133544448*x^22*A^4*B^2 + 364216320*x^23*A^2*B^3 + 209995776*x^24*B^4 - 19901036*x^18*A^9 + 14737920*x^19*A^7*B + 447236928*x^20*A^5*B^2 + 533376000*x^21*A^3*B^3 + 992489472*x^22*A*B^4 - 8116242*x^16*A^10 - 181155888*x^17*A^8*B + 338391168*x^18*A^6*B^2 + 741335040*x^19*A^4*B^3 + 2530340352*x^20*A^2*B^4 + 452689920*x^21*B^5 + 7190448*x^14*A^11 - 172455168*x^15*A^9*B - 402744384*x^16*A^7*B^2 + 43587072*x^17*A^5*B^3 + 3223127040*x^18*A^3*B^4 + 3155927040*x^19*A*B^5 + 7456644*x^12*A^12 - 22640064*x^13*A^10*B - 615036672*x^14*A^8*B^2 - 1557872640*x^15*A^6*B^3 - 373547520*x^16*A^4*B^4 + 6567948288*x^17*A^2*B^5 + 1560477696*x^18*B^6 + 2606472*x^10*A^13 + 30200832*x^11*A^11*B - 138437184*x^12*A^9*B^2 - 1671936000*x^13*A^7*B^3 - 4962889728*x^14*A^5*B^4 + 95256576*x^15*A^3*B^5 + 6510845952*x^16*A*B^6 + 714996*x^8*A^14 + 9733280*x^9*A^12*B + 112791168*x^10*A^10*B^2 - 458158080*x^11*A^8*B^3 - 3559228416*x^12*A^6*B^4 - 11318280192*x^13*A^4*B^5 + 1350696960*x^14*A^2*B^6 + 2157576192*x^15*B^7 + 88272*x^6*A^15 + 3341568*x^7*A^13*B + 27139392*x^8*A^11*B^2 + 285068800*x^9*A^9*B^3 - 759146496*x^10*A^7*B^4 - 6944145408*x^11*A^5*B^5 - 16939892736*x^12*A^3*B^6 + 20054016*x^13*A*B^7 + 10137*x^4*A^16 + 247488*x^5*A^14*B + 10742784*x^6*A^12*B^2 + 53035008*x^7*A^10*B^3 + 549688320*x^8*A^8*B^4 - 627892224*x^9*A^6*B^5 - 11101372416*x^10*A^4*B^6 - 18262130688*x^11*A^2*B^7 - 795672576*x^12*B^8 - 210*x^2*A^17 + 41472*x^3*A^15*B + 426432*x^4*A^13*B^2 + 21089280*x^5*A^11*B^3 + 110714880*x^6*A^9*B^4 + 679182336*x^7*A^7*B^5 + 577732608*x^8*A^5*B^6 - 14597750784*x^9*A^3*B^7 - 12533760000*x^10*A*B^8 + A^18 - 456*x*A^16*B + 54144*x^2*A^14*B^2 + 983040*x^3*A^12*B^3 + 23827968*x^4*A^10*B^4 + 217202688*x^5*A^8*B^5 + 552665088*x^6*A^6*B^6 + 2051407872*x^7*A^4*B^7 - 14164623360*x^8*A^2*B^8 - 3636985856*x^9*B^9 - 192*A^15*B^2 + 23040*x*A^13*B^3 + 1360896*x^2*A^11*B^4 + 20619264*x^3*A^9*B^5 + 258293760*x^4*A^7*B^6 + 624033792*x^5*A^5*B^7 + 1568931840*x^6*A^3*B^8 - 7656701952*x^7*A*B^9 + 1536*A^12*B^4 + 749568*x*A^10*B^5 + 17006592*x^2*A^8*B^6 + 189923328*x^3*A^6*B^7 + 772669440*x^4*A^4*B^8 + 286261248*x^5*A^2*B^9 - 1572864000*x^6*B^10 + 122880*A^9*B^6 + 8650752*x*A^7*B^7 + 110886912*x^2*A^5*B^8 + 566231040*x^3*A^3*B^9 + 31457280*x^4*A*B^10 + 1572864*A^6*B^8 + 47185920*x*A^4*B^9 + 276824064*x^2*A^2*B^10 + 50331648*x^3*B^11 + 8388608*A^3*B^10 + 100663296*x*A*B^11 + 16777216*B^12, x^54 + 333*x^52*A - 46665*x^50*A^2 + 14004*x^51*B - 61965*x^48*A^3 - 700740*x^49*A*B - 11598930*x^46*A^4 + 8653680*x^47*A^2*B - 7962120*x^48*B^2 - 154158282*x^44*A^5 + 7026960*x^45*A^3*B - 35128800*x^46*A*B^2 - 922228038*x^42*A^6 - 917319672*x^43*A^4*B - 771391296*x^44*A^2*B^2 + 86023680*x^45*B^3 - 3845062014*x^40*A^7 - 6314686056*x^41*A^5*B - 11379356640*x^42*A^3*B^2 - 2776542336*x^43*A*B^3 - 8570651061*x^38*A^8 - 39903599376*x^39*A^6*B - 45895195440*x^40*A^4*B^2 - 67017944448*x^41*A^2*B^3 - 7753091328*x^42*B^4 - 15210522769*x^36*A^9 - 89511234288*x^37*A^7*B - 300298487328*x^38*A^5*B^2 - 242621487360*x^39*A^3*B^3 - 255793135104*x^40*A*B^4 - 40009201755*x^34*A^10 - 60875531028*x^35*A^8*B - 892213931136*x^36*A^6*B^2 - 1187584600320*x^37*A^4*B^3 - 1384564366080*x^38*A^2*B^4 - 319660471296*x^39*B^5 - 104533137543*x^32*A^11 - 40664875548*x^33*A^9*B - 1200399031584*x^34*A^7*B^2 - 3438768034944*x^35*A^5*B^3 - 5775727837440*x^36*A^3*B^4 - 3264872813568*x^37*A*B^5 - 155749784076*x^30*A^12 - 661556500512*x^31*A^10*B - 266089959000*x^32*A^8*B^2 - 6905549430144*x^33*A^6*B^3 - 10898817592320*x^34*A^4*B^4 - 20354747351040*x^35*A^2*B^5 - 1854228486144*x^36*B^6 - 81453459420*x^28*A^13 - 2008018487520*x^29*A^11*B - 854440294080*x^30*A^9*B^2 - 9090042657792*x^31*A^7*B^3 - 12639389121792*x^32*A^5*B^4 - 48945486956544*x^33*A^3*B^5 - 28916722888704*x^34*A*B^6 + 81453459420*x^26*A^14 - 2280696863760*x^27*A^12*B - 7700391492480*x^28*A^10*B^2 - 11691584071680*x^29*A^8*B^3 - 23475108658176*x^30*A^6*B^4 - 45735121022976*x^31*A^4*B^5 - 111990403141632*x^32*A^2*B^6 - 16336098312192*x^33*B^7 + 155749784076*x^24*A^15 - 546685089840*x^25*A^13*B - 13326035855040*x^26*A^11*B^2 - 30418882341120*x^27*A^9*B^3 - 59687945733120*x^28*A^7*B^4 - 33912504889344*x^29*A^5*B^5 - 164731854569472*x^30*A^3*B^6 - 118684680781824*x^31*A*B^7 + 104533137543*x^22*A^16 + 1054490916960*x^23*A^14*B - 6543128501280*x^24*A^12*B^2 - 51028226968320*x^25*A^10*B^3 - 128011330506240*x^26*A^8*B^4 - 152806529261568*x^27*A^6*B^5 - 112028864864256*x^28*A^4*B^6 - 293973358215168*x^29*A^2*B^7 - 37593824034816*x^30*B^8 + 40009201755*x^20*A^17 + 980081041824*x^21*A^15*B + 4203658998720*x^22*A^13*B^2 - 31214388856320*x^23*A^11*B^3 - 166182552668160*x^24*A^9*B^4 - 421309831790592*x^25*A^7*B^5 - 292110016020480*x^26*A^5*B^6 - 365440857538560*x^27*A^3*B^7 - 193137418764288*x^28*A*B^8 + 15210522769*x^18*A^18 + 313480746444*x^19*A^16*B + 5927125132800*x^20*A^14*B^2 + 9948569817600*x^21*A^12*B^3 - 86422931274240*x^22*A^10*B^4 - 519314784122880*x^23*A^8*B^5 - 950634850959360*x^24*A^6*B^6 - 714503335772160*x^25*A^4*B^7 - 428700504489984*x^26*A^2*B^8 - 41746885771264*x^27*B^9 + 8570651061*x^16*A^19 + 37615903812*x^17*A^17*B + 2370535922112*x^18*A^15*B^2 + 20404567745280*x^19*A^13*B^3 + 38417402257920*x^20*A^11*B^4 - 236941048903680*x^21*A^9*B^5 - 1216199386644480*x^22*A^7*B^6 - 1932317472522240*x^23*A^5*B^7 - 1179911772241920*x^24*A^3*B^8 - 221502828183552*x^25*A*B^9 + 3845062014*x^14*A^20 + 23231535792*x^15*A^18*B + 338298348744*x^16*A^16*B^2 + 8997215627520*x^17*A^14*B^3 + 62010418191360*x^18*A^12*B^4 + 119040549838848*x^19*A^10*B^5 - 516542112092160*x^20*A^8*B^6 - 2363100933980160*x^21*A^6*B^7 - 3297061565890560*x^22*A^4*B^8 - 1159925229158400*x^23*A^2*B^9 - 47978081943552*x^24*B^10 + 922228038*x^12*A^21 + 21411976656*x^13*A^19*B + 50983735968*x^14*A^17*B^2 + 1622787941376*x^15*A^15*B^3 + 24585456591360*x^16*A^13*B^4 + 165641534779392*x^17*A^11*B^5 + 286582683475968*x^18*A^9*B^6 - 840109653098496*x^19*A^7*B^7 - 4024747034542080*x^20*A^5*B^8 - 4158895219015680*x^21*A^3*B^9 - 669222558498816*x^22*A*B^10 + 154158282*x^10*A^22 + 5201091720*x^11*A^20*B + 87723660480*x^12*A^18*B^2 + 73087246848*x^13*A^16*B^3 + 5131666805760*x^14*A^14*B^4 + 54324238749696*x^15*A^12*B^5 + 368735413837824*x^16*A^10*B^6 + 605802003333120*x^17*A^8*B^7 - 1111364514349056*x^18*A^6*B^8 - 5738467342417920*x^19*A^4*B^9 - 3563185577656320*x^20*A^2*B^10 - 177477116755968*x^21*B^11 + 11598930*x^8*A^23 + 1001005080*x^9*A^21*B + 17299527840*x^10*A^19*B^2 + 282124477824*x^11*A^17*B^3 + 150263368704*x^12*A^15*B^4 + 11052846895104*x^13*A^13*B^5 + 106199385882624*x^14*A^11*B^6 + 658134776217600*x^15*A^9*B^7 + 1198599415529472*x^16*A^7*B^8 - 1451692070535168*x^17*A^5*B^9 - 6255181465387008*x^18*A^3*B^10 - 1815076549951488*x^19*A*B^11 + 61965*x^6*A^24 + 81163440*x^7*A^22*B + 3244810320*x^8*A^20*B^2 + 47497848960*x^9*A^18*B^3 + 662010892032*x^10*A^16*B^4 + 1068173254656*x^11*A^14*B^5 + 14800016351232*x^12*A^12*B^6 + 191125733179392*x^13*A^10*B^7 + 937977563381760*x^14*A^8*B^8 + 2092395345739776*x^15*A^6*B^9 - 2017919533842432*x^16*A^4*B^10 - 4608564400226304*x^17*A^2*B^11 - 401834439081984*x^18*B^12 + 46665*x^4*A^25 - 1260720*x^5*A^23*B + 278068320*x^6*A^21*B^2 + 7161050880*x^7*A^19*B^3 + 107513740800*x^8*A^17*B^4 + 1207511973888*x^9*A^15*B^5 + 3973625413632*x^10*A^13*B^6 + 12421195628544*x^11*A^11*B^7 + 283594088448000*x^12*A^9*B^8 + 1165028087562240*x^13*A^7*B^9 + 2796855320641536*x^14*A^5*B^10 - 2248426603413504*x^15*A^3*B^11 - 1936696937545728*x^16*A*B^12 - 333*x^2*A^26 + 189972*x^3*A^24*B - 3740544*x^4*A^22*B^2 + 497237760*x^5*A^20*B^3 + 13235846400*x^6*A^18*B^4 + 183230401536*x^7*A^16*B^5 + 1903351283712*x^8*A^14*B^6 + 8434148376576*x^9*A^12*B^7 + 10932056948736*x^10*A^10*B^8 + 307745182187520*x^11*A^8*B^9 + 1381935209250816*x^12*A^6*B^10 + 2632313280135168*x^13*A^4*B^11 - 1498863240216576*x^14*A^2*B^12 - 336016296640512*x^15*B^13 - A^27 - 612*x*A^25*B + 263520*x^2*A^23*B^2 - 1056384*x^3*A^21*B^3 + 470603520*x^4*A^19*B^4 + 19549154304*x^5*A^17*B^5 + 251674214400*x^6*A^15*B^6 + 2522296811520*x^7*A^13*B^7 + 13165991755776*x^8*A^11*B^8 + 16515049717760*x^9*A^9*B^9 + 240421768790016*x^10*A^7*B^10 + 1463445488664576*x^11*A^5*B^11 + 1781368136663040*x^12*A^3*B^12 - 479536386932736*x^13*A*B^13 - 360*A^24*B^2 + 148608*x*A^22*B^3 + 4773888*x^2*A^20*B^4 + 275079168*x^3*A^18*B^5 + 19419752448*x^4*A^16*B^6 + 302252359680*x^5*A^14*B^7 + 2699165564928*x^6*A^12*B^8 + 16444768124928*x^7*A^10*B^9 + 26997249540096*x^8*A^8*B^10 + 136444794372096*x^9*A^6*B^11 + 1249596407808000*x^10*A^4*B^12 + 920605301932032*x^11*A^2*B^13 - 48655402795008*x^12*B^14 + 25344*A^21*B^4 + 4626432*x*A^19*B^5 + 161501184*x^2*A^17*B^6 + 12106727424*x^3*A^15*B^7 + 284637265920*x^4*A^13*B^8 + 2527114297344*x^5*A^11*B^9 + 15682360049664*x^6*A^9*B^10 + 38215612366848*x^7*A^7*B^11 + 49533438394368*x^8*A^5*B^12 + 835036265840640*x^9*A^3*B^13 + 332307256836096*x^10*A*B^14 + 1142784*A^18*B^6 + 91865088*x*A^16*B^7 + 5078384640*x^2*A^14*B^8 + 180840038400*x^3*A^12*B^9 + 2090367713280*x^4*A^10*B^10 + 11868127100928*x^5*A^8*B^11 + 38813854334976*x^6*A^6*B^12 + 14863942287360*x^7*A^4*B^13 + 409244616622080*x^8*A^2*B^14 + 56973814923264*x^9*B^15 + 22413312*A^15*B^8 + 1627914240*x*A^13*B^9 + 73326919680*x^2*A^11*B^10 + 1299185664000*x^3*A^9*B^11 + 8057593528320*x^4*A^7*B^12 + 26390292332544*x^5*A^5*B^13 + 16645682626560*x^6*A^3*B^14 + 122554744307712*x^7*A*B^15 + 298844160*A^12*B^10 + 19251855360*x*A^10*B^11 + 524959088640*x^2*A^8*B^12 + 4650644275200*x^3*A^6*B^13 + 13927773634560*x^4*A^4*B^14 + 13239236689920*x^5*A^2*B^15 + 15616501088256*x^6*B^16 + 2768240640*A^9*B^12 + 128849018880*x*A^7*B^13 + 1860257710080*x^2*A^5*B^14 + 6803228196864*x^3*A^3*B^15 + 3904125272064*x^4*A*B^16 + 16106127360*A^6*B^14 + 444529115136*x*A^4*B^15 + 2628519985152*x^2*A^2*B^16 + 309237645312*x^3*B^17 + 51539607552*A^3*B^16 + 618475290624*x*A*B^17 + 68719476736*B^18, 6*x^16*y + 144*x^14*y*A - 728*x^12*y*A^2 + 1344*x^13*y*B - 2576*x^10*y*A^3 - 1884*x^8*y*A^4 - 9152*x^9*y*A^2*B - 5376*x^10*y*B^2 - 2576*x^6*y*A^5 + 1536*x^7*y*A^3*B - 39744*x^8*y*A*B^2 - 728*x^4*y*A^6 - 6720*x^5*y*A^4*B - 5376*x^6*y*A^2*B^2 - 44544*x^7*y*B^3 + 144*x^2*y*A^7 - 3584*x^3*y*A^5*B - 8064*x^4*y*A^3*B^2 - 32256*x^5*y*A*B^3 + 6*y*A^8 + 192*x*y*A^6*B - 3072*x^2*y*A^4*B^2 - 25088*x^3*y*A^2*B^3 - 10752*x^4*y*B^4 + 192*y*A^5*B^2 - 512*x*y*A^3*B^3 - 27648*x^2*y*A*B^4 + 1024*y*A^2*B^4 - 12288*x*y*B^5 7, x^49 - 392*x^47*A + 35812*x^45*A^2 - 15680*x^46*B + 480872*x^43*A^3 + 237552*x^44*A*B + 7448210*x^41*A^4 + 1697376*x^42*A^2*B + 3099936*x^43*B^2 + 44652776*x^39*A^5 + 53642960*x^40*A^3*B + 49693056*x^41*A*B^2 + 242246004*x^37*A^6 + 144539136*x^38*A^4*B + 772003008*x^39*A^2*B^2 + 117794432*x^40*B^3 + 309029560*x^35*A^7 + 2717923152*x^36*A^5*B + 475144320*x^37*A^3*B^2 + 4402189568*x^38*A*B^3 - 1322425377*x^33*A^8 + 8989764448*x^34*A^6*B + 8800490400*x^35*A^4*B^2 + 12516702464*x^36*A^2*B^3 + 8046988544*x^37*B^4 - 4852649424*x^31*A^9 - 1748940816*x^32*A^7*B + 49257379584*x^33*A^5*B^2 + 41968451840*x^34*A^3*B^3 + 52633715712*x^35*A*B^4 - 4257271480*x^29*A^10 - 61353450368*x^30*A^8*B + 54561566976*x^31*A^6*B^2 + 99383043200*x^32*A^4*B^3 + 280661767680*x^33*A^2*B^4 + 21865396224*x^34*B^5 + 5767309968*x^27*A^11 - 121510826912*x^28*A^9*B - 185710296576*x^29*A^7*B^2 - 97503616000*x^30*A^5*B^3 + 663524126720*x^31*A^3*B^4 + 440121034752*x^32*A*B^5 + 17765213116*x^25*A^12 - 73726863168*x^26*A^10*B - 555721109440*x^27*A^8*B^2 - 1128328754176*x^28*A^6*B^3 - 314085811200*x^29*A^4*B^4 + 1677764100096*x^30*A^2*B^5 + 332897173504*x^31*B^6 + 20675902800*x^23*A^13 + 56659979040*x^24*A^11*B - 453736953600*x^25*A^9*B^2 - 2407726906368*x^26*A^7*B^3 - 4549965815808*x^27*A^5*B^4 - 513974181888*x^28*A^3*B^5 + 2252666601472*x^29*A*B^6 + 16243941000*x^21*A^14 + 116722609920*x^22*A^12*B + 251407363200*x^23*A^10*B^2 - 2158166465280*x^24*A^8*B^3 - 8031640694784*x^25*A^6*B^4 - 13923917586432*x^26*A^4*B^5 - 165877612544*x^27*A^2*B^6 + 819255771136*x^28*B^7 + 10498988528*x^19*A^15 + 94529145760*x^20*A^13*B + 649785696000*x^21*A^11*B^2 + 464617448960*x^22*A^9*B^3 - 6140968243200*x^23*A^7*B^4 - 24443841429504*x^24*A^5*B^5 - 27948836880384*x^25*A^3*B^6 - 2176380960768*x^26*A*B^7 + 5142876879*x^17*A^16 + 66680815040*x^18*A^14*B + 478268678720*x^19*A^12*B^2 + 2361033274880*x^20*A^10*B^3 + 1310176796160*x^21*A^8*B^4 - 15505181540352*x^22*A^6*B^5 - 56136641003520*x^23*A^4*B^6 - 42617102008320*x^24*A^2*B^7 - 2232647811072*x^25*B^8 + 1815296728*x^15*A^17 + 34527872736*x^16*A^15*B + 326239441920*x^17*A^13*B^2 + 1654217653760*x^18*A^11*B^3 + 7315640944640*x^19*A^9*B^4 + 3115411955712*x^20*A^7*B^5 - 31319400284160*x^21*A^5*B^6 - 102272377159680*x^22*A^3*B^7 - 39326597775360*x^23*A*B^8 + 550005204*x^13*A^18 + 10234261184*x^14*A^16*B + 181460025600*x^15*A^14*B^2 + 1021187032320*x^16*A^12*B^3 + 5262100085760*x^17*A^10*B^4 + 16359986614272*x^18*A^8*B^5 + 12770199601152*x^19*A^6*B^6 - 63630941552640*x^20*A^4*B^7 - 127490227568640*x^21*A^2*B^8 - 14287115386880*x^22*B^9 + 94431624*x^11*A^19 + 3570996912*x^12*A^17*B + 39714314752*x^13*A^15*B^2 + 669903877120*x^14*A^13*B^3 + 2574889390080*x^15*A^11*B^4 + 13599147233280*x^16*A^9*B^5 + 29745720754176*x^17*A^7*B^6 + 35754272096256*x^18*A^5*B^7 - 114692303093760*x^19*A^3*B^8 - 83670511124480*x^20*A*B^9 - 3995950*x^9*A^20 + 940535008*x^10*A^18*B + 9788234400*x^11*A^16*B^2 + 152157752320*x^12*A^14*B^3 + 1639996718080*x^13*A^12*B^4 + 6768223420416*x^14*A^10*B^5 + 23897489817600*x^15*A^8*B^6 + 58713910542336*x^16*A^6*B^7 + 39612907192320*x^17*A^4*B^8 - 119211331420160*x^18*A^2*B^9 - 20337268883456*x^19*B^10 - 2097592*x^7*A^21 + 20021008*x^8*A^19*B + 3445504384*x^9*A^17*B^2 + 24083182592*x^10*A^15*B^3 + 397896826880*x^11*A^13*B^4 + 3327119007744*x^12*A^11*B^5 + 14661237047296*x^13*A^9*B^6 + 34396631728128*x^14*A^7*B^7 + 97412434624512*x^15*A^5*B^8 + 14681330155520*x^16*A^3*B^9 - 56313709068288*x^17*A*B^10 + 53508*x^5*A^22 - 15090432*x^6*A^20*B + 173001920*x^7*A^18*B^2 + 7479161984*x^8*A^16*B^3 + 62995824640*x^9*A^14*B^4 + 706282823680*x^10*A^12*B^5 + 6120510226432*x^11*A^10*B^6 + 24148702986240*x^12*A^8*B^7 + 48995330162688*x^13*A^6*B^8 + 110397489152000*x^14*A^4*B^9 + 6232215650304*x^15*A^2*B^10 - 8951873667072*x^16*B^11 + 4312*x^3*A^23 + 88592*x^4*A^21*B - 39984000*x^5*A^19*B^2 + 271543552*x^6*A^17*B^3 + 13700452352*x^7*A^15*B^4 + 122281033728*x^8*A^13*B^5 + 1047515004928*x^9*A^11*B^6 + 9127994982400*x^10*A^9*B^7 + 34128924770304*x^11*A^7*B^8 + 59818266066944*x^12*A^5*B^9 + 93257279209472*x^13*A^3*B^10 + 9466577682432*x^14*A*B^11 + 49*x*A^24 + 10976*x^2*A^22*B + 152096*x^3*A^20*B^2 - 59180800*x^4*A^18*B^3 - 89522944*x^5*A^16*B^4 + 20338999296*x^6*A^14*B^5 + 186914422784*x^7*A^12*B^6 + 1337464848384*x^8*A^10*B^7 + 10940271820800*x^9*A^8*B^8 + 41786919616512*x^10*A^6*B^9 + 58648587927552*x^11*A^4*B^10 + 61147516502016*x^12*A^2*B^11 + 3858860343296*x^13*B^12 + 48*A^23*B + 12544*x*A^21*B^2 + 313600*x^2*A^19*B^3 - 53079040*x^3*A^17*B^4 - 757686272*x^4*A^15*B^5 + 19484803072*x^5*A^13*B^6 + 249853771776*x^6*A^11*B^7 + 1406812815360*x^7*A^9*B^8 + 10860164546560*x^8*A^7*B^9 + 42410792976384*x^9*A^5*B^10 + 47237157617664*x^10*A^3*B^11 + 25587938754560*x^11*A*B^12 + 5760*A^20*B^3 + 376320*x*A^18*B^4 - 26707968*x^2*A^16*B^5 - 1023475712*x^3*A^14*B^6 + 8549761024*x^4*A^12*B^7 + 261722603520*x^5*A^10*B^8 + 1353905602560*x^6*A^8*B^9 + 8516068704256*x^7*A^6*B^10 + 36153122095104*x^8*A^4*B^11 + 27843501228032*x^9*A^2*B^12 + 4609305214976*x^10*B^13 + 174080*A^17*B^5 - 4358144*x*A^15*B^6 - 669777920*x^2*A^13*B^7 - 2251554816*x^3*A^11*B^8 + 178234327040*x^4*A^9*B^9 + 1262191902720*x^5*A^7*B^10 + 5127335313408*x^6*A^5*B^11 + 25256756510720*x^7*A^3*B^12 + 9608512929792*x^8*A*B^13 + 1310720*A^14*B^7 - 201392128*x*A^12*B^8 - 4616880128*x^2*A^10*B^9 + 61575528448*x^3*A^8*B^10 + 938232250368*x^4*A^6*B^11 + 2790973767680*x^5*A^4*B^12 + 12773769609216*x^6*A^2*B^13 + 1382711033856*x^7*B^14 - 12058624*A^11*B^9 - 1981808640*x*A^9*B^10 - 352321536*x^2*A^7*B^11 + 440636801024*x^3*A^5*B^12 + 1658260029440*x^4*A^3*B^13 + 3934726914048*x^5*A*B^14 - 230686720*A^8*B^11 - 6811549696*x*A^6*B^12 + 98650030080*x^2*A^4*B^13 + 845571686400*x^3*A^2*B^14 + 548682072064*x^4*B^15 - 1207959552*A^5*B^13 + 255550554112*x^2*A*B^15 - 2147483648*A^2*B^15 + 30064771072*x*B^16, x^72*y + 612*x^70*y*A - 162978*x^68*y*A^2 + 35304*x^69*y*B + 292468*x^66*y*A^3 - 3434544*x^67*y*A*B - 136715887*x^64*y*A^4 + 89908104*x^65*y*A^2*B - 50917584*x^66*y*B^2 - 2878540896*x^62*y*A^5 - 200586496*x^63*y*A^3*B - 189519264*x^64*y*A*B^2 - 27433746480*x^60*y*A^6 - 26018484672*x^61*y*A^4*B - 16463183616*x^62*y*A^2*B^2 + 1762855424*x^63*y*B^3 - 199034507872*x^58*y*A^7 - 246004159104*x^59*y*A^5*B - 406415978496*x^60*y*A^3*B^2 - 85929177600*x^61*y*A*B^3 - 609871362252*x^56*y*A^8 - 3109591425472*x^57*y*A^6*B - 2039624365440*x^58*y*A^4*B^2 - 3320266882560*x^59*y*A^2*B^3 - 324496236288*x^60*y*B^4 - 2174973922000*x^54*y*A^9 - 7471676126976*x^55*y*A^7*B - 33552575179008*x^56*y*A^5*B^2 - 12713923320320*x^57*y*A^3*B^3 - 17693603873280*x^58*y*A*B^4 - 14130630520248*x^52*y*A^10 + 4101348572640*x^53*y*A^8*B - 130922115667200*x^54*y*A^6*B^2 - 169642743723520*x^55*y*A^4*B^3 - 125014623694080*x^56*y*A^2*B^4 - 30593851180032*x^57*y*B^5 - 68900083189392*x^50*y*A^11 - 8605433289024*x^51*y*A^9*B - 217926712194048*x^52*y*A^7*B^2 - 632259170357760*x^53*y*A^5*B^3 - 1064741840757760*x^54*y*A^3*B^4 - 436341351665664*x^55*y*A*B^5 - 167073184622428*x^48*y*A^12 - 708249198446496*x^49*y*A^10*B + 251792366015808*x^50*y*A^8*B^2 - 2313505685601792*x^51*y*A^6*B^3 - 2023621737603840*x^52*y*A^4*B^4 - 5310527812356096*x^53*y*A^2*B^5 - 300860200374272*x^54*y*B^6 - 91360535934752*x^46*y*A^13 - 3432590319777024*x^47*y*A^11*B - 1510401726798720*x^48*y*A^9*B^2 - 5617556690680320*x^49*y*A^7*B^3 - 2839612341671424*x^50*y*A^5*B^4 - 15966902375829504*x^51*y*A^3*B^5 - 10499159812128768*x^52*y*A*B^6 + 523260349630896*x^44*y*A^14 - 6319832437196096*x^45*y*A^12*B - 19246254403993344*x^46*y*A^10*B^2 - 19775991018769920*x^47*y*A^8*B^3 - 20022971241857280*x^48*y*A^6*B^4 - 14067513340627968*x^49*y*A^4*B^5 - 53537876183273472*x^50*y*A^2*B^6 - 8755093109587968*x^51*y*B^7 + 1553783847153120*x^42*y*A^15 - 1462692262238592*x^43*y*A^13*B - 52561037092497408*x^44*y*A^11*B^2 - 105937656830343680*x^45*y*A^9*B^3 - 134205196037990400*x^46*y*A^7*B^4 - 30925995255521280*x^47*y*A^5*B^5 - 102913273858596864*x^48*y*A^3*B^6 - 77563938707767296*x^49*y*A*B^7 + 2202358583484334*x^40*y*A^16 + 14305027505731776*x^41*y*A^14*B - 39106894162292352*x^42*y*A^12*B^2 - 289086484679849472*x^43*y*A^10*B^3 - 577759130084770560*x^44*y*A^8*B^4 - 511772340052611072*x^45*y*A^6*B^5 - 129845846052691968*x^46*y*A^4*B^6 - 282127071306645504*x^47*y*A^2*B^7 - 21064201313255424*x^48*y*B^8 + 2075223517438872*x^38*y*A^17 + 27568828118888704*x^39*y*A^15*B + 83848236937690368*x^40*y*A^13*B^2 - 288150785984709120*x^41*y*A^11*B^3 - 1307489312312578560*x^42*y*A^9*B^4 - 2587819974973415424*x^43*y*A^7*B^5 - 1412854420406796288*x^44*y*A^5*B^6 - 739059060674002944*x^45*y*A^3*B^7 - 175647413834219520*x^46*y*A*B^8 + 1816604592687668*x^36*y*A^18 + 24188364321167856*x^37*y*A^16*B + 233740320180806400*x^38*y*A^14*B^2 + 290912493768020480*x^39*y*A^12*B^3 - 1100665640787077376*x^40*y*A^10*B^4 - 5742889576667882496*x^41*y*A^8*B^5 - 8045848338535636992*x^42*y*A^6*B^6 - 4636406057539829760*x^43*y*A^4*B^7 - 970153724430581760*x^44*y*A^2*B^8 - 41844404386004992*x^45*y*B^9 + 2081868962549880*x^34*y*A^19 + 10768360169152224*x^35*y*A^17*B + 260741969978213376*x^36*y*A^15*B^2 + 1105696332226577920*x^37*y*A^13*B^3 + 1634943929953182720*x^38*y*A^11*B^4 - 4860522253044215808*x^39*y*A^9*B^5 - 18185259299370713088*x^40*y*A^7*B^6 - 23340295415514857472*x^41*y*A^5*B^7 - 9455819414325166080*x^42*y*A^3*B^8 - 714994366210375680*x^43*y*A*B^9 + 2538487471297470*x^32*y*A^20 + 4938213117297840*x^33*y*A^18*B + 159674077167432480*x^34*y*A^16*B^2 + 1354621280545958400*x^35*y*A^14*B^3 + 5208812350876391680*x^36*y*A^12*B^4 + 6015450608356902912*x^37*y*A^10*B^5 - 14804059057960218624*x^38*y*A^8*B^6 - 50783304720310665216*x^39*y*A^6*B^7 - 53425567137380106240*x^40*y*A^4*B^8 - 12789734049440071680*x^41*y*A^2*B^9 - 262667338773430272*x^42*y*B^10 + 2426936257526880*x^30*y*A^21 + 11127753499695360*x^31*y*A^19*B + 61668134973403200*x^32*y*A^17*B^2 + 930904307722206720*x^33*y*A^15*B^3 + 6029608774158789120*x^34*y*A^13*B^4 + 20062780231079596032*x^35*y*A^11*B^5 + 19790995374247657472*x^36*y*A^9*B^6 - 36491892793689636864*x^37*y*A^7*B^7 - 122012582934277914624*x^38*y*A^5*B^8 - 90704095535520808960*x^39*y*A^3*B^9 - 10517403941380030464*x^40*y*A*B^10 + 1696580718326448*x^28*y*A^22 + 17013167618521536*x^29*y*A^20*B + 60234577174506240*x^30*y*A^18*B^2 + 381946382350917120*x^31*y*A^16*B^3 + 4159131490833580800*x^32*y*A^14*B^4 + 22433531142090765312*x^33*y*A^12*B^5 + 64979639941811933184*x^34*y*A^10*B^6 + 59086360834020458496*x^35*y*A^8*B^7 - 79232480419818700800*x^36*y*A^6*B^8 - 240363895120741007360*x^37*y*A^4*B^9 - 104485562491597750272*x^38*y*A^2*B^10 - 3902901613781581824*x^39*y*B^11 + 907560369156192*x^26*y*A^23 + 14306349236932224*x^27*y*A^21*B + 99474411797913600*x^28*y*A^19*B^2 + 242477286523169280*x^29*y*A^17*B^3 + 1941894157686067200*x^30*y*A^15*B^4 + 14377136352762839040*x^31*y*A^13*B^5 + 72771756636016779264*x^32*y*A^11*B^6 + 175153360755721666560*x^33*y*A^9*B^7 + 163115052450946744320*x^34*y*A^7*B^8 - 170970271166053220352*x^35*y*A^5*B^9 - 352304775105376944128*x^36*y*A^3*B^10 - 70106489441721778176*x^37*y*A*B^11 + 386288639722308*x^24*y*A^24 + 8228741098923456*x^25*y*A^22*B + 87607101541325184*x^26*y*A^20*B^2 + 438407993230394880*x^27*y*A^18*B^3 + 981788616192111360*x^28*y*A^16*B^4 + 7175172121225371648*x^29*y*A^14*B^5 + 42934712506577633280*x^30*y*A^12*B^6 + 198875673228087263232*x^31*y*A^10*B^7 + 411593760714182492160*x^32*y*A^8*B^8 + 370428770703129968640*x^33*y*A^6*B^9 - 333497117491272351744*x^34*y*A^4*B^10 - 335430537364157497344*x^35*y*A^2*B^11 - 19665775940669014016*x^36*y*B^12 + 120954844413872*x^22*y*A^25 + 3898468576998144*x^23*y*A^23*B + 46675751997102336*x^24*y*A^21*B^2 + 429364204725711360*x^25*y*A^19*B^3 + 1514352362146122240*x^26*y*A^17*B^4 + 4131045401518522368*x^27*y*A^15*B^5 + 19080125103636086784*x^28*y*A^13*B^6 + 118589226305883734016*x^29*y*A^11*B^7 + 444236358785178009600*x^30*y*A^9*B^8 + 884893785796126965760*x^31*y*A^7*B^9 + 600182863343690711040*x^32*y*A^5*B^10 - 449628989590540910592*x^33*y*A^3*B^11 - 172637135404529614848*x^34*y*A*B^12 + 24406973693256*x^20*y*A^26 + 1383103275723488*x^21*y*A^24*B + 21623159441819904*x^22*y*A^22*B^2 + 215726629324905984*x^23*y*A^20*B^3 + 1634866861525551360*x^24*y*A^18*B^4 + 4852173177755882496*x^25*y*A^16*B^5 + 13384163107097395200*x^26*y*A^14*B^6 + 44631917838383382528*x^27*y*A^12*B^7 + 278361275412880687104*x^28*y*A^10*B^8 + 858409417355388518400*x^29*y*A^8*B^9 + 1643202476113924194304*x^30*y*A^6*B^10 + 681239054352453206016*x^31*y*A^4*B^11 - 332181781120467075072*x^32*y*A^2*B^12 - 34201864154615119872*x^33*y*B^13 + 3489467691248*x^18*y*A^27 + 283160582291136*x^19*y*A^25*B + 8459338339144704*x^20*y*A^23*B^2 + 88190815411325440*x^21*y*A^21*B^3 + 832997479741056000*x^22*y*A^19*B^4 + 5035360671800414208*x^23*y*A^17*B^5 + 15002165577455271936*x^24*y*A^15*B^6 + 32089157098943938560*x^25*y*A^13*B^7 + 105912310217463300096*x^26*y*A^11*B^8 + 521444709873766891520*x^27*y*A^9*B^9 + 1532780478042816380928*x^28*y*A^7*B^10 + 2411187739143004225536*x^29*y*A^5*B^11 + 638147167197486645248*x^30*y*A^3*B^12 - 103633925249905459200*x^31*y*A*B^13 + 774955167252*x^16*y*A^28 + 26376200064864*x^17*y*A^26*B + 1916049951984960*x^18*y*A^24*B^2 + 34413088973964800*x^19*y*A^22*B^3 + 310554321428727552*x^20*y*A^20*B^4 + 2570452669693151232*x^21*y*A^18*B^5 + 13750219448169222144*x^22*y*A^16*B^6 + 39753384831263047680*x^23*y*A^14*B^7 + 69167471257133383680*x^24*y*A^12*B^8 + 217488301081293225984*x^25*y*A^10*B^9 + 837335526412577144832*x^26*y*A^8*B^10 + 2414502003790539915264*x^27*y*A^6*B^11 + 2769465444486464143360*x^28*y*A^4*B^12 + 529519463964176547840*x^29*y*A^2*B^13 - 5499364594340069376*x^30*y*B^14 + 261241476384*x^14*y*A^29 + 1421440962816*x^15*y*A^27*B + 204180859488384*x^16*y*A^25*B^2 + 7866877417689600*x^17*y*A^23*B^3 + 114313982826728960*x^18*y*A^21*B^4 + 914166833838280704*x^19*y*A^19*B^5 + 6700692649775579136*x^20*y*A^17*B^6 + 33164752739654959104*x^21*y*A^15*B^7 + 91124945478207406080*x^22*y*A^13*B^8 + 139071522593958789120*x^23*y*A^11*B^9 + 368250335221122072576*x^24*y*A^9*B^10 + 1215273841126105153536*x^25*y*A^7*B^11 + 3176327619232476954624*x^26*y*A^5*B^12 + 2489963819280011100160*x^27*y*A^3*B^13 + 288547285472976568320*x^28*y*A*B^14 + 37994286288*x^12*y*A^30 + 1732160039232*x^13*y*A^28*B - 5431067258112*x^14*y*A^26*B^2 + 1000391908861440*x^15*y*A^24*B^3 + 23491944627989760*x^16*y*A^22*B^4 + 323662870897523712*x^17*y*A^20*B^5 + 2268625050969198592*x^18*y*A^18*B^6 + 15178177280411025408*x^19*y*A^16*B^7 + 70061719902838456320*x^20*y*A^14*B^8 + 184810516085827174400*x^21*y*A^12*B^9 + 251590242937067274240*x^22*y*A^10*B^10 + 529731647045766217728*x^23*y*A^8*B^11 + 1582562981429643313152*x^24*y*A^6*B^12 + 3416891198892398346240*x^25*y*A^4*B^13 + 1590464241396508262400*x^26*y*A^2*B^14 + 65934481942900637696*x^27*y*B^15 - 1227138528*x^10*y*A^31 + 445522621824*x^11*y*A^29*B + 3641301153792*x^12*y*A^27*B^2 + 5924649042432*x^13*y*A^25*B^3 + 2822091932620800*x^14*y*A^23*B^4 + 60551380623237120*x^15*y*A^21*B^5 + 749771574084870144*x^16*y*A^19*B^6 + 5041069766508183552*x^17*y*A^17*B^7 + 29323631678958600192*x^18*y*A^15*B^8 + 132707161756024176640*x^19*y*A^13*B^9 + 324593622831568257024*x^20*y*A^11*B^10 + 423262274832266428416*x^21*y*A^9*B^11 + 615494876439477485568*x^22*y*A^7*B^12 + 1890125766213488345088*x^23*y*A^5*B^13 + 2787230401565483335680*x^24*y*A^3*B^14 + 599475634624782139392*x^25*y*A*B^15 - 284370471*x^8*y*A^32 + 836075328*x^9*y*A^30*B + 2034853425792*x^10*y*A^28*B^2 + 4777723522560*x^11*y*A^26*B^3 + 84748636204800*x^12*y*A^24*B^4 + 5819815903703040*x^13*y*A^22*B^5 + 132366752876666880*x^14*y*A^20*B^6 + 1470829514330406912*x^15*y*A^18*B^7 + 9885247803859599360*x^16*y*A^16*B^8 + 49706043274155786240*x^17*y*A^14*B^9 + 220705343916388384768*x^18*y*A^12*B^10 + 508990833400486035456*x^19*y*A^10*B^11 + 614007502296085168128*x^20*y*A^8*B^12 + 620022491382389145600*x^21*y*A^6*B^13 + 1944840008506540032000*x^22*y*A^4*B^14 + 1510740137736822325248*x^23*y*A^2*B^15 + 95650328309479243776*x^24*y*B^16 - 1550556*x^6*y*A^33 - 2009246976*x^7*y*A^31*B + 26464838400*x^8*y*A^29*B^2 + 5561215756800*x^9*y*A^27*B^3 + 18608253159936*x^10*y*A^25*B^4 + 142563192053760*x^11*y*A^23*B^5 + 10629757047275520*x^12*y*A^21*B^6 + 234018316940083200*x^13*y*A^19*B^7 + 2550978170480885760*x^14*y*A^17*B^8 + 16652068759573364736*x^15*y*A^15*B^9 + 76706132643620585472*x^16*y*A^13*B^10 + 314402549853484744704*x^17*y*A^11*B^11 + 732453476326986219520*x^18*y*A^9*B^12 + 708424611708681584640*x^19*y*A^7*B^13 + 660885193521830559744*x^20*y*A^5*B^14 + 1458982707735834918912*x^21*y*A^3*B^15 + 461218020140173492224*x^22*y*A*B^16 - 222754*x^4*y*A^34 + 1746792*x^5*y*A^32*B - 6567761664*x^6*y*A^30*B^2 + 67389949440*x^7*y*A^28*B^3 + 10975249992960*x^8*y*A^26*B^4 + 76266636678144*x^9*y*A^24*B^5 + 49860827258880*x^10*y*A^22*B^6 + 16405449813688320*x^11*y*A^20*B^7 + 345505407669043200*x^12*y*A^18*B^8 + 3855560607194152960*x^13*y*A^16*B^9 + 24542542372867670016*x^14*y*A^14*B^10 + 106501678318900740096*x^15*y*A^12*B^11 + 390724198687020417024*x^16*y*A^10*B^12 + 930032982277037752320*x^17*y*A^8*B^13 + 687045510683217100800*x^18*y*A^6*B^14 + 657139387455183519744*x^19*y*A^4*B^15 + 685013483526266290176*x^20*y*A^2*B^16 + 58473370473688203264*x^21*y*B^17 - 5964*x^2*y*A^35 - 554032*x^3*y*A^33*B + 678912*x^4*y*A^31*B^2 - 11904007680*x^5*y*A^29*B^3 + 18766126080*x^6*y*A^27*B^4 + 16752809373696*x^7*y*A^25*B^5 + 195030096003072*x^8*y*A^23*B^6 + 62026304913408*x^9*y*A^21*B^7 + 18426248390246400*x^10*y*A^19*B^8 + 444918903708057600*x^11*y*A^17*B^9 + 4971126542772994048*x^12*y*A^15*B^10 + 32143980965708955648*x^13*y*A^13*B^11 + 130924371932067397632*x^14*y*A^11*B^12 + 432465433907303546880*x^15*y*A^9*B^13 + 1005071544315858124800*x^16*y*A^7*B^14 + 611071367566678032384*x^17*y*A^5*B^15 + 456137129998587789312*x^18*y*A^3*B^16 + 174316850613256716288*x^19*y*A*B^17 - 7*y*A^36 - 11256*x*y*A^34*B - 969936*x^2*y*A^32*B^2 - 10629632*x^3*y*A^30*B^3 - 13390429440*x^4*y*A^28*B^4 - 170012362752*x^5*y*A^26*B^5 + 18672158306304*x^6*y*A^24*B^6 + 347128766595072*x^7*y*A^22*B^7 + 724195646963712*x^8*y*A^20*B^8 + 13548370025512960*x^9*y*A^18*B^9 + 488551480971755520*x^10*y*A^16*B^10 + 5539534881555480576*x^11*y*A^14*B^11 + 36805926002578423808*x^12*y*A^12*B^12 + 144089109410378416128*x^13*y*A^10*B^13 + 422152138402289418240*x^14*y*A^8*B^14 + 929402889942161424384*x^15*y*A^6*B^15 + 469087430159603073024*x^16*y*A^4*B^16 + 190563742537085878272*x^17*y*A^2*B^17 + 18108312745412657152*x^18*y*B^18 - 6048*y*A^33*B^2 - 1086976*x*y*A^31*B^3 - 28746240*x^2*y*A^29*B^4 - 9736163328*x^3*y*A^27*B^5 - 337620320256*x^4*y*A^25*B^6 + 13334857777152*x^5*y*A^23*B^7 + 442853383864320*x^6*y*A^21*B^8 + 2230664744140800*x^7*y*A^19*B^9 + 6294140853682176*x^8*y*A^17*B^10 + 427188348122038272*x^9*y*A^15*B^11 + 5425037300306280448*x^10*y*A^13*B^12 + 36313846295644078080*x^11*y*A^11*B^13 + 142284520151045898240*x^12*y*A^9*B^14 + 360649894035562954752*x^13*y*A^7*B^15 + 735643201968845881344*x^14*y*A^5*B^16 + 270893496501106900992*x^15*y*A^3*B^17 + 43234830613468938240*x^16*y*A*B^18 - 487168*y*A^30*B^4 - 36283392*x*y*A^28*B^5 - 4737306624*x^2*y*A^26*B^6 - 314506199040*x^3*y*A^24*B^7 + 4300327157760*x^4*y*A^22*B^8 + 390095306489856*x^5*y*A^20*B^9 + 3812006846005248*x^6*y*A^18*B^10 + 5327046850904064*x^7*y*A^16*B^11 + 273077734735872000*x^8*y*A^14*B^12 + 4594679599417262080*x^9*y*A^12*B^13 + 31125678161745936384*x^10*y*A^10*B^14 + 123117193303664099328*x^11*y*A^8*B^15 + 274046860970139058176*x^12*y*A^6*B^16 + 480054757165734297600*x^13*y*A^4*B^17 + 106481850717453680640*x^14*y*A^2*B^18 + 4199787797063663616*x^15*y*B^19 - 16818176*y*A^27*B^6 - 1760722944*x*y*A^25*B^7 - 166601687040*x^2*y*A^23*B^8 - 1334003630080*x^3*y*A^21*B^9 + 219551448956928*x^4*y*A^19*B^10 + 4111320307728384*x^5*y*A^17*B^11 + 12724434527846400*x^6*y*A^15*B^12 + 115656208102195200*x^7*y*A^13*B^13 + 3186954974999347200*x^8*y*A^11*B^14 + 23539935184167108608*x^9*y*A^9*B^15 + 91160840991160664064*x^10*y*A^7*B^16 + 187077951477698789376*x^11*y*A^5*B^17 + 242726701919937495040*x^12*y*A^3*B^18 + 25709943614204805120*x^13*y*A*B^19 - 460062720*y*A^24*B^8 - 53262417920*x*y*A^22*B^9 - 1890846769152*x^2*y*A^20*B^10 + 66006584131584*x^3*y*A^18*B^11 + 2818679343415296*x^4*y*A^16*B^12 + 19346003727482880*x^5*y*A^14*B^13 + 40781245977722880*x^6*y*A^12*B^14 + 1658369078659645440*x^7*y*A^10*B^15 + 15596590281296707584*x^8*y*A^8*B^16 + 57784096306501779456*x^9*y*A^6*B^17 + 110951883285620326400*x^10*y*A^4*B^18 + 87860583293371023360*x^11*y*A^2*B^19 + 2928887870162731008*x^12*y*B^20 - 9873391616*y*A^21*B^10 - 759806558208*x*y*A^19*B^11 + 2724653432832*x^2*y*A^17*B^12 + 1163786887102464*x^3*y*A^15*B^13 + 16730143158435840*x^4*y*A^13*B^14 + 40940281100500992*x^5*y*A^11*B^15 + 577495066327646208*x^6*y*A^9*B^16 + 8576938639437594624*x^7*y*A^7*B^17 + 32248589731007299584*x^8*y*A^5*B^18 + 52815667761847992320*x^9*y*A^3*B^19 + 20059617680494166016*x^10*y*A*B^20 - 136885305344*y*A^18*B^12 - 4346439794688*x*y*A^16*B^13 + 246568703754240*x^2*y*A^14*B^14 + 8414317674233856*x^3*y*A^12*B^15 + 47101454636285952*x^4*y*A^10*B^16 + 137934523978481664*x^5*y*A^8*B^17 + 3536050010770636800*x^6*y*A^6*B^18 + 16176262457956761600*x^7*y*A^4*B^19 + 18046515244129320960*x^8*y*A^2*B^20 + 2148489701139415040*x^9*y*B^21 - 1101659111424*y*A^15*B^14 + 10282151706624*x*y*A^13*B^15 + 2331342608007168*x^2*y*A^11*B^16 + 30002236348170240*x^3*y*A^9*B^17 + 63708452492410880*x^4*y*A^7*B^18 + 953421716816658432*x^5*y*A^5*B^19 + 6913346485409021952*x^6*y*A^3*B^20 + 3774104448666697728*x^7*y*A*B^21 - 4329327034368*y*A^12*B^16 + 285735584268288*x*y*A^10*B^17 + 10101763080192000*x^2*y*A^8*B^18 + 48873291854643200*x^3*y*A^6*B^19 + 153338991121268736*x^4*y*A^4*B^20 + 2193631250529386496*x^5*y*A^2*B^21 + 349222485167702016*x^6*y*B^22 + 1616282092830720*x*y*A^7*B^19 + 20734590276599808*x^2*y*A^5*B^20 + 32422398879858688*x^3*y*A^3*B^21 + 428756758274506752*x^4*y*A*B^22 + 69269232549888*y*A^6*B^20 + 4033008650682368*x*y*A^4*B^21 + 15252425300508672*x^2*y*A^2*B^22 + 37788015623405568*x^3*y*B^23 + 246290604621824*y*A^3*B^22 + 3799912185593856*x*y*A*B^23 + 281474976710656*y*B^24, 7*x^24 + 308*x^22*A - 2954*x^20*A^2 + 3944*x^21*B - 19852*x^18*A^3 - 112*x^19*A*B - 35231*x^16*A^4 - 92568*x^17*A^2*B - 42896*x^18*B^2 - 82264*x^14*A^5 - 31808*x^15*A^3*B - 571872*x^16*A*B^2 - 111916*x^12*A^6 - 161840*x^13*A^4*B - 615360*x^14*A^2*B^2 - 829696*x^15*B^3 - 42168*x^10*A^7 - 608160*x^11*A^5*B - 297472*x^12*A^3*B^2 - 2132480*x^13*A*B^3 + 15673*x^8*A^8 - 425712*x^9*A^6*B - 1192800*x^10*A^4*B^2 - 2603776*x^11*A^2*B^3 - 928256*x^12*B^4 + 14756*x^6*A^9 - 53824*x^7*A^7*B - 831936*x^8*A^5*B^2 - 3727360*x^9*A^3*B^3 - 3293696*x^10*A*B^4 + 1302*x^4*A^10 + 57288*x^5*A^8*B - 190400*x^6*A^6*B^2 - 1314560*x^7*A^4*B^3 - 7069440*x^8*A^2*B^4 - 1555456*x^9*B^5 + 196*x^2*A^11 + 1680*x^3*A^9*B + 134400*x^4*A^7*B^2 - 168448*x^5*A^5*B^3 - 2293760*x^6*A^3*B^4 - 7127040*x^7*A*B^5 - A^12 + 392*x*A^10*B + 3696*x^2*A^8*B^2 + 152320*x^3*A^6*B^3 + 394240*x^4*A^4*B^4 - 3698688*x^5*A^2*B^5 - 2809856*x^6*B^6 + 160*A^9*B^2 + 7168*x*A^7*B^3 + 96768*x^2*A^5*B^4 + 831488*x^3*A^3*B^5 - 3039232*x^4*A*B^6 + 3328*A^6*B^4 + 64512*x*A^4*B^5 + 544768*x^2*A^2*B^6 - 802816*x^3*B^7 + 24576*A^3*B^6 + 229376*x*A*B^7 + 65536*B^8
In [5]:
# compute first 7 division polynomials using recurrence relations
M=8

psi=[R(0) for m in range(0,M+2)]
for m in range(0,5):
psi[m]=P[m][2]
psi[3]=-psi[3]    # fix sign of psi_3 to match definition

# note that we need psi[m+2] to compute omega[m]
for n in range(5,M+2):
m = n//2
if n==2*m:
psi[2*m]  =reduce_poly(R(psi[m]*(psi[m+2]*psi[m-1]^2-psi[m-2]*psi[m+1]^2)/(2*y)))
else:
psi[2*m+1]=reduce_poly(psi[m+2]*psi[m]^3-psi[m-1]*psi[m+1]^3)

phi=[R(0) for m in range(0,M)]
for m in range(1,M): phi[m] = reduce_poly(x*psi[m]^2-psi[m+1]*psi[m-1])

omega=[R(0) for m in range(0,M)]
omega[0]=1
omega[1]=y
for m in range(2,M): omega[m] = reduce_poly(R((psi[m+2]*psi[m-1]^2-psi[m-2]*psi[m+1]^2)/(4*y)))

In [8]:
# verify that we get the same result using the recurrences as when we used the group law
for m in range(1,M):
print("%d: %s"%(m,compare_point(P[m],(phi[m],omega[m],psi[m]))))

1: True 2: True 3: True 4: True 5: True 6: True 7: True
In [9]:
P[7][2]

7*x^24 + 308*x^22*A - 2954*x^20*A^2 + 3944*x^21*B - 19852*x^18*A^3 - 112*x^19*A*B - 35231*x^16*A^4 - 92568*x^17*A^2*B - 42896*x^18*B^2 - 82264*x^14*A^5 - 31808*x^15*A^3*B - 571872*x^16*A*B^2 - 111916*x^12*A^6 - 161840*x^13*A^4*B - 615360*x^14*A^2*B^2 - 829696*x^15*B^3 - 42168*x^10*A^7 - 608160*x^11*A^5*B - 297472*x^12*A^3*B^2 - 2132480*x^13*A*B^3 + 15673*x^8*A^8 - 425712*x^9*A^6*B - 1192800*x^10*A^4*B^2 - 2603776*x^11*A^2*B^3 - 928256*x^12*B^4 + 14756*x^6*A^9 - 53824*x^7*A^7*B - 831936*x^8*A^5*B^2 - 3727360*x^9*A^3*B^3 - 3293696*x^10*A*B^4 + 1302*x^4*A^10 + 57288*x^5*A^8*B - 190400*x^6*A^6*B^2 - 1314560*x^7*A^4*B^3 - 7069440*x^8*A^2*B^4 - 1555456*x^9*B^5 + 196*x^2*A^11 + 1680*x^3*A^9*B + 134400*x^4*A^7*B^2 - 168448*x^5*A^5*B^3 - 2293760*x^6*A^3*B^4 - 7127040*x^7*A*B^5 - A^12 + 392*x*A^10*B + 3696*x^2*A^8*B^2 + 152320*x^3*A^6*B^3 + 394240*x^4*A^4*B^4 - 3698688*x^5*A^2*B^5 - 2809856*x^6*B^6 + 160*A^9*B^2 + 7168*x*A^7*B^3 + 96768*x^2*A^5*B^4 + 831488*x^3*A^3*B^5 - 3039232*x^4*A*B^6 + 3328*A^6*B^4 + 64512*x*A^4*B^5 + 544768*x^2*A^2*B^6 - 802816*x^3*B^7 + 24576*A^3*B^6 + 229376*x*A*B^7 + 65536*B^8
In [10]:
# this is a more thorough point reduction function that removes common factors
def reduce_point(P):
x3 = reduce_poly(P[0])
y3 = reduce_poly(P[1])
z3 = reduce_poly(P[2])
z32 = reduce_poly(z3^2)
z33 = reduce_poly(z3^3)
h = R((y3*numerator(x3/z32)) / (x3*numerator(y3/z33)))
x3 = R(x3/h^2); y3 = R(y3/h^3); z3 = R(z3/h)
if z3.mod(y) == 0 and x3.mod(x^3+A*x+B) == 0 and y3.mod((x^3+A*x+B)^2) == 0:
z3 = R(z3/y); x3 = R(x3/(x^3+A*x+B)); y3 = R(y*y3/(x^3+A*x+B)^2)
if z3.mod(x^3+A*x+B) == 0 and x3.mod(x^3+A*x+B) == 0 and y3.mod((x^3+A*x+B)*y) == 0:
z3 = R(y*z3/(x^3+A*x+B)); x3 = R(x3/(x^3+A*x+B)); y3 = R(y3/(y*(x^3+A*x+B)))
xc = gcd([int(c) for c in x3.coefficients()])
yc = gcd([int(c) for c in y3.coefficients()])
zc = gcd([int(c) for c in z3.coefficients()])
if zc%2 == 0 and xc%4 == 0 and yc%8 == 0:
z3 = R(z3/2); x3 = R(x3/4); y3 = R(y3/8);
xc = gcd([int(c) for c in x3.coefficients()])
yc = gcd([int(c) for c in y3.coefficients()])
zc = gcd([int(c) for c in z3.coefficients()])
if zc%2 == 0 and xc%4 == 0 and yc%8 == 0:
z3 = R(z3/2); x3 = R(x3/4); y3 = R(y3/8);
return (x3,y3,z3)

In [12]:
print(P[7][1])

x^72*y + 612*x^70*y*A - 162978*x^68*y*A^2 + 35304*x^69*y*B + 292468*x^66*y*A^3 - 3434544*x^67*y*A*B - 136715887*x^64*y*A^4 + 89908104*x^65*y*A^2*B - 50917584*x^66*y*B^2 - 2878540896*x^62*y*A^5 - 200586496*x^63*y*A^3*B - 189519264*x^64*y*A*B^2 - 27433746480*x^60*y*A^6 - 26018484672*x^61*y*A^4*B - 16463183616*x^62*y*A^2*B^2 + 1762855424*x^63*y*B^3 - 199034507872*x^58*y*A^7 - 246004159104*x^59*y*A^5*B - 406415978496*x^60*y*A^3*B^2 - 85929177600*x^61*y*A*B^3 - 609871362252*x^56*y*A^8 - 3109591425472*x^57*y*A^6*B - 2039624365440*x^58*y*A^4*B^2 - 3320266882560*x^59*y*A^2*B^3 - 324496236288*x^60*y*B^4 - 2174973922000*x^54*y*A^9 - 7471676126976*x^55*y*A^7*B - 33552575179008*x^56*y*A^5*B^2 - 12713923320320*x^57*y*A^3*B^3 - 17693603873280*x^58*y*A*B^4 - 14130630520248*x^52*y*A^10 + 4101348572640*x^53*y*A^8*B - 130922115667200*x^54*y*A^6*B^2 - 169642743723520*x^55*y*A^4*B^3 - 125014623694080*x^56*y*A^2*B^4 - 30593851180032*x^57*y*B^5 - 68900083189392*x^50*y*A^11 - 8605433289024*x^51*y*A^9*B - 217926712194048*x^52*y*A^7*B^2 - 632259170357760*x^53*y*A^5*B^3 - 1064741840757760*x^54*y*A^3*B^4 - 436341351665664*x^55*y*A*B^5 - 167073184622428*x^48*y*A^12 - 708249198446496*x^49*y*A^10*B + 251792366015808*x^50*y*A^8*B^2 - 2313505685601792*x^51*y*A^6*B^3 - 2023621737603840*x^52*y*A^4*B^4 - 5310527812356096*x^53*y*A^2*B^5 - 300860200374272*x^54*y*B^6 - 91360535934752*x^46*y*A^13 - 3432590319777024*x^47*y*A^11*B - 1510401726798720*x^48*y*A^9*B^2 - 5617556690680320*x^49*y*A^7*B^3 - 2839612341671424*x^50*y*A^5*B^4 - 15966902375829504*x^51*y*A^3*B^5 - 10499159812128768*x^52*y*A*B^6 + 523260349630896*x^44*y*A^14 - 6319832437196096*x^45*y*A^12*B - 19246254403993344*x^46*y*A^10*B^2 - 19775991018769920*x^47*y*A^8*B^3 - 20022971241857280*x^48*y*A^6*B^4 - 14067513340627968*x^49*y*A^4*B^5 - 53537876183273472*x^50*y*A^2*B^6 - 8755093109587968*x^51*y*B^7 + 1553783847153120*x^42*y*A^15 - 1462692262238592*x^43*y*A^13*B - 52561037092497408*x^44*y*A^11*B^2 - 105937656830343680*x^45*y*A^9*B^3 - 134205196037990400*x^46*y*A^7*B^4 - 30925995255521280*x^47*y*A^5*B^5 - 102913273858596864*x^48*y*A^3*B^6 - 77563938707767296*x^49*y*A*B^7 + 2202358583484334*x^40*y*A^16 + 14305027505731776*x^41*y*A^14*B - 39106894162292352*x^42*y*A^12*B^2 - 289086484679849472*x^43*y*A^10*B^3 - 577759130084770560*x^44*y*A^8*B^4 - 511772340052611072*x^45*y*A^6*B^5 - 129845846052691968*x^46*y*A^4*B^6 - 282127071306645504*x^47*y*A^2*B^7 - 21064201313255424*x^48*y*B^8 + 2075223517438872*x^38*y*A^17 + 27568828118888704*x^39*y*A^15*B + 83848236937690368*x^40*y*A^13*B^2 - 288150785984709120*x^41*y*A^11*B^3 - 1307489312312578560*x^42*y*A^9*B^4 - 2587819974973415424*x^43*y*A^7*B^5 - 1412854420406796288*x^44*y*A^5*B^6 - 739059060674002944*x^45*y*A^3*B^7 - 175647413834219520*x^46*y*A*B^8 + 1816604592687668*x^36*y*A^18 + 24188364321167856*x^37*y*A^16*B + 233740320180806400*x^38*y*A^14*B^2 + 290912493768020480*x^39*y*A^12*B^3 - 1100665640787077376*x^40*y*A^10*B^4 - 5742889576667882496*x^41*y*A^8*B^5 - 8045848338535636992*x^42*y*A^6*B^6 - 4636406057539829760*x^43*y*A^4*B^7 - 970153724430581760*x^44*y*A^2*B^8 - 41844404386004992*x^45*y*B^9 + 2081868962549880*x^34*y*A^19 + 10768360169152224*x^35*y*A^17*B + 260741969978213376*x^36*y*A^15*B^2 + 1105696332226577920*x^37*y*A^13*B^3 + 1634943929953182720*x^38*y*A^11*B^4 - 4860522253044215808*x^39*y*A^9*B^5 - 18185259299370713088*x^40*y*A^7*B^6 - 23340295415514857472*x^41*y*A^5*B^7 - 9455819414325166080*x^42*y*A^3*B^8 - 714994366210375680*x^43*y*A*B^9 + 2538487471297470*x^32*y*A^20 + 4938213117297840*x^33*y*A^18*B + 159674077167432480*x^34*y*A^16*B^2 + 1354621280545958400*x^35*y*A^14*B^3 + 5208812350876391680*x^36*y*A^12*B^4 + 6015450608356902912*x^37*y*A^10*B^5 - 14804059057960218624*x^38*y*A^8*B^6 - 50783304720310665216*x^39*y*A^6*B^7 - 53425567137380106240*x^40*y*A^4*B^8 - 12789734049440071680*x^41*y*A^2*B^9 - 262667338773430272*x^42*y*B^10 + 2426936257526880*x^30*y*A^21 + 11127753499695360*x^31*y*A^19*B + 61668134973403200*x^32*y*A^17*B^2 + 930904307722206720*x^33*y*A^15*B^3 + 6029608774158789120*x^34*y*A^13*B^4 + 20062780231079596032*x^35*y*A^11*B^5 + 19790995374247657472*x^36*y*A^9*B^6 - 36491892793689636864*x^37*y*A^7*B^7 - 122012582934277914624*x^38*y*A^5*B^8 - 90704095535520808960*x^39*y*A^3*B^9 - 10517403941380030464*x^40*y*A*B^10 + 1696580718326448*x^28*y*A^22 + 17013167618521536*x^29*y*A^20*B + 60234577174506240*x^30*y*A^18*B^2 + 381946382350917120*x^31*y*A^16*B^3 + 4159131490833580800*x^32*y*A^14*B^4 + 22433531142090765312*x^33*y*A^12*B^5 + 64979639941811933184*x^34*y*A^10*B^6 + 59086360834020458496*x^35*y*A^8*B^7 - 79232480419818700800*x^36*y*A^6*B^8 - 240363895120741007360*x^37*y*A^4*B^9 - 104485562491597750272*x^38*y*A^2*B^10 - 3902901613781581824*x^39*y*B^11 + 907560369156192*x^26*y*A^23 + 14306349236932224*x^27*y*A^21*B + 99474411797913600*x^28*y*A^19*B^2 + 242477286523169280*x^29*y*A^17*B^3 + 1941894157686067200*x^30*y*A^15*B^4 + 14377136352762839040*x^31*y*A^13*B^5 + 72771756636016779264*x^32*y*A^11*B^6 + 175153360755721666560*x^33*y*A^9*B^7 + 163115052450946744320*x^34*y*A^7*B^8 - 170970271166053220352*x^35*y*A^5*B^9 - 352304775105376944128*x^36*y*A^3*B^10 - 70106489441721778176*x^37*y*A*B^11 + 386288639722308*x^24*y*A^24 + 8228741098923456*x^25*y*A^22*B + 87607101541325184*x^26*y*A^20*B^2 + 438407993230394880*x^27*y*A^18*B^3 + 981788616192111360*x^28*y*A^16*B^4 + 7175172121225371648*x^29*y*A^14*B^5 + 42934712506577633280*x^30*y*A^12*B^6 + 198875673228087263232*x^31*y*A^10*B^7 + 411593760714182492160*x^32*y*A^8*B^8 + 370428770703129968640*x^33*y*A^6*B^9 - 333497117491272351744*x^34*y*A^4*B^10 - 335430537364157497344*x^35*y*A^2*B^11 - 19665775940669014016*x^36*y*B^12 + 120954844413872*x^22*y*A^25 + 3898468576998144*x^23*y*A^23*B + 46675751997102336*x^24*y*A^21*B^2 + 429364204725711360*x^25*y*A^19*B^3 + 1514352362146122240*x^26*y*A^17*B^4 + 4131045401518522368*x^27*y*A^15*B^5 + 19080125103636086784*x^28*y*A^13*B^6 + 118589226305883734016*x^29*y*A^11*B^7 + 444236358785178009600*x^30*y*A^9*B^8 + 884893785796126965760*x^31*y*A^7*B^9 + 600182863343690711040*x^32*y*A^5*B^10 - 449628989590540910592*x^33*y*A^3*B^11 - 172637135404529614848*x^34*y*A*B^12 + 24406973693256*x^20*y*A^26 + 1383103275723488*x^21*y*A^24*B + 21623159441819904*x^22*y*A^22*B^2 + 215726629324905984*x^23*y*A^20*B^3 + 1634866861525551360*x^24*y*A^18*B^4 + 4852173177755882496*x^25*y*A^16*B^5 + 13384163107097395200*x^26*y*A^14*B^6 + 44631917838383382528*x^27*y*A^12*B^7 + 278361275412880687104*x^28*y*A^10*B^8 + 858409417355388518400*x^29*y*A^8*B^9 + 1643202476113924194304*x^30*y*A^6*B^10 + 681239054352453206016*x^31*y*A^4*B^11 - 332181781120467075072*x^32*y*A^2*B^12 - 34201864154615119872*x^33*y*B^13 + 3489467691248*x^18*y*A^27 + 283160582291136*x^19*y*A^25*B + 8459338339144704*x^20*y*A^23*B^2 + 88190815411325440*x^21*y*A^21*B^3 + 832997479741056000*x^22*y*A^19*B^4 + 5035360671800414208*x^23*y*A^17*B^5 + 15002165577455271936*x^24*y*A^15*B^6 + 32089157098943938560*x^25*y*A^13*B^7 + 105912310217463300096*x^26*y*A^11*B^8 + 521444709873766891520*x^27*y*A^9*B^9 + 1532780478042816380928*x^28*y*A^7*B^10 + 2411187739143004225536*x^29*y*A^5*B^11 + 638147167197486645248*x^30*y*A^3*B^12 - 103633925249905459200*x^31*y*A*B^13 + 774955167252*x^16*y*A^28 + 26376200064864*x^17*y*A^26*B + 1916049951984960*x^18*y*A^24*B^2 + 34413088973964800*x^19*y*A^22*B^3 + 310554321428727552*x^20*y*A^20*B^4 + 2570452669693151232*x^21*y*A^18*B^5 + 13750219448169222144*x^22*y*A^16*B^6 + 39753384831263047680*x^23*y*A^14*B^7 + 69167471257133383680*x^24*y*A^12*B^8 + 217488301081293225984*x^25*y*A^10*B^9 + 837335526412577144832*x^26*y*A^8*B^10 + 2414502003790539915264*x^27*y*A^6*B^11 + 2769465444486464143360*x^28*y*A^4*B^12 + 529519463964176547840*x^29*y*A^2*B^13 - 5499364594340069376*x^30*y*B^14 + 261241476384*x^14*y*A^29 + 1421440962816*x^15*y*A^27*B + 204180859488384*x^16*y*A^25*B^2 + 7866877417689600*x^17*y*A^23*B^3 + 114313982826728960*x^18*y*A^21*B^4 + 914166833838280704*x^19*y*A^19*B^5 + 6700692649775579136*x^20*y*A^17*B^6 + 33164752739654959104*x^21*y*A^15*B^7 + 91124945478207406080*x^22*y*A^13*B^8 + 139071522593958789120*x^23*y*A^11*B^9 + 368250335221122072576*x^24*y*A^9*B^10 + 1215273841126105153536*x^25*y*A^7*B^11 + 3176327619232476954624*x^26*y*A^5*B^12 + 2489963819280011100160*x^27*y*A^3*B^13 + 288547285472976568320*x^28*y*A*B^14 + 37994286288*x^12*y*A^30 + 1732160039232*x^13*y*A^28*B - 5431067258112*x^14*y*A^26*B^2 + 1000391908861440*x^15*y*A^24*B^3 + 23491944627989760*x^16*y*A^22*B^4 + 323662870897523712*x^17*y*A^20*B^5 + 2268625050969198592*x^18*y*A^18*B^6 + 15178177280411025408*x^19*y*A^16*B^7 + 70061719902838456320*x^20*y*A^14*B^8 + 184810516085827174400*x^21*y*A^12*B^9 + 251590242937067274240*x^22*y*A^10*B^10 + 529731647045766217728*x^23*y*A^8*B^11 + 1582562981429643313152*x^24*y*A^6*B^12 + 3416891198892398346240*x^25*y*A^4*B^13 + 1590464241396508262400*x^26*y*A^2*B^14 + 65934481942900637696*x^27*y*B^15 - 1227138528*x^10*y*A^31 + 445522621824*x^11*y*A^29*B + 3641301153792*x^12*y*A^27*B^2 + 5924649042432*x^13*y*A^25*B^3 + 2822091932620800*x^14*y*A^23*B^4 + 60551380623237120*x^15*y*A^21*B^5 + 749771574084870144*x^16*y*A^19*B^6 + 5041069766508183552*x^17*y*A^17*B^7 + 29323631678958600192*x^18*y*A^15*B^8 + 132707161756024176640*x^19*y*A^13*B^9 + 324593622831568257024*x^20*y*A^11*B^10 + 423262274832266428416*x^21*y*A^9*B^11 + 615494876439477485568*x^22*y*A^7*B^12 + 1890125766213488345088*x^23*y*A^5*B^13 + 2787230401565483335680*x^24*y*A^3*B^14 + 599475634624782139392*x^25*y*A*B^15 - 284370471*x^8*y*A^32 + 836075328*x^9*y*A^30*B + 2034853425792*x^10*y*A^28*B^2 + 4777723522560*x^11*y*A^26*B^3 + 84748636204800*x^12*y*A^24*B^4 + 5819815903703040*x^13*y*A^22*B^5 + 132366752876666880*x^14*y*A^20*B^6 + 1470829514330406912*x^15*y*A^18*B^7 + 9885247803859599360*x^16*y*A^16*B^8 + 49706043274155786240*x^17*y*A^14*B^9 + 220705343916388384768*x^18*y*A^12*B^10 + 508990833400486035456*x^19*y*A^10*B^11 + 614007502296085168128*x^20*y*A^8*B^12 + 620022491382389145600*x^21*y*A^6*B^13 + 1944840008506540032000*x^22*y*A^4*B^14 + 1510740137736822325248*x^23*y*A^2*B^15 + 95650328309479243776*x^24*y*B^16 - 1550556*x^6*y*A^33 - 2009246976*x^7*y*A^31*B + 26464838400*x^8*y*A^29*B^2 + 5561215756800*x^9*y*A^27*B^3 + 18608253159936*x^10*y*A^25*B^4 + 142563192053760*x^11*y*A^23*B^5 + 10629757047275520*x^12*y*A^21*B^6 + 234018316940083200*x^13*y*A^19*B^7 + 2550978170480885760*x^14*y*A^17*B^8 + 16652068759573364736*x^15*y*A^15*B^9 + 76706132643620585472*x^16*y*A^13*B^10 + 314402549853484744704*x^17*y*A^11*B^11 + 732453476326986219520*x^18*y*A^9*B^12 + 708424611708681584640*x^19*y*A^7*B^13 + 660885193521830559744*x^20*y*A^5*B^14 + 1458982707735834918912*x^21*y*A^3*B^15 + 461218020140173492224*x^22*y*A*B^16 - 222754*x^4*y*A^34 + 1746792*x^5*y*A^32*B - 6567761664*x^6*y*A^30*B^2 + 67389949440*x^7*y*A^28*B^3 + 10975249992960*x^8*y*A^26*B^4 + 76266636678144*x^9*y*A^24*B^5 + 49860827258880*x^10*y*A^22*B^6 + 16405449813688320*x^11*y*A^20*B^7 + 345505407669043200*x^12*y*A^18*B^8 + 3855560607194152960*x^13*y*A^16*B^9 + 24542542372867670016*x^14*y*A^14*B^10 + 106501678318900740096*x^15*y*A^12*B^11 + 390724198687020417024*x^16*y*A^10*B^12 + 930032982277037752320*x^17*y*A^8*B^13 + 687045510683217100800*x^18*y*A^6*B^14 + 657139387455183519744*x^19*y*A^4*B^15 + 685013483526266290176*x^20*y*A^2*B^16 + 58473370473688203264*x^21*y*B^17 - 5964*x^2*y*A^35 - 554032*x^3*y*A^33*B + 678912*x^4*y*A^31*B^2 - 11904007680*x^5*y*A^29*B^3 + 18766126080*x^6*y*A^27*B^4 + 16752809373696*x^7*y*A^25*B^5 + 195030096003072*x^8*y*A^23*B^6 + 62026304913408*x^9*y*A^21*B^7 + 18426248390246400*x^10*y*A^19*B^8 + 444918903708057600*x^11*y*A^17*B^9 + 4971126542772994048*x^12*y*A^15*B^10 + 32143980965708955648*x^13*y*A^13*B^11 + 130924371932067397632*x^14*y*A^11*B^12 + 432465433907303546880*x^15*y*A^9*B^13 + 1005071544315858124800*x^16*y*A^7*B^14 + 611071367566678032384*x^17*y*A^5*B^15 + 456137129998587789312*x^18*y*A^3*B^16 + 174316850613256716288*x^19*y*A*B^17 - 7*y*A^36 - 11256*x*y*A^34*B - 969936*x^2*y*A^32*B^2 - 10629632*x^3*y*A^30*B^3 - 13390429440*x^4*y*A^28*B^4 - 170012362752*x^5*y*A^26*B^5 + 18672158306304*x^6*y*A^24*B^6 + 347128766595072*x^7*y*A^22*B^7 + 724195646963712*x^8*y*A^20*B^8 + 13548370025512960*x^9*y*A^18*B^9 + 488551480971755520*x^10*y*A^16*B^10 + 5539534881555480576*x^11*y*A^14*B^11 + 36805926002578423808*x^12*y*A^12*B^12 + 144089109410378416128*x^13*y*A^10*B^13 + 422152138402289418240*x^14*y*A^8*B^14 + 929402889942161424384*x^15*y*A^6*B^15 + 469087430159603073024*x^16*y*A^4*B^16 + 190563742537085878272*x^17*y*A^2*B^17 + 18108312745412657152*x^18*y*B^18 - 6048*y*A^33*B^2 - 1086976*x*y*A^31*B^3 - 28746240*x^2*y*A^29*B^4 - 9736163328*x^3*y*A^27*B^5 - 337620320256*x^4*y*A^25*B^6 + 13334857777152*x^5*y*A^23*B^7 + 442853383864320*x^6*y*A^21*B^8 + 2230664744140800*x^7*y*A^19*B^9 + 6294140853682176*x^8*y*A^17*B^10 + 427188348122038272*x^9*y*A^15*B^11 + 5425037300306280448*x^10*y*A^13*B^12 + 36313846295644078080*x^11*y*A^11*B^13 + 142284520151045898240*x^12*y*A^9*B^14 + 360649894035562954752*x^13*y*A^7*B^15 + 735643201968845881344*x^14*y*A^5*B^16 + 270893496501106900992*x^15*y*A^3*B^17 + 43234830613468938240*x^16*y*A*B^18 - 487168*y*A^30*B^4 - 36283392*x*y*A^28*B^5 - 4737306624*x^2*y*A^26*B^6 - 314506199040*x^3*y*A^24*B^7 + 4300327157760*x^4*y*A^22*B^8 + 390095306489856*x^5*y*A^20*B^9 + 3812006846005248*x^6*y*A^18*B^10 + 5327046850904064*x^7*y*A^16*B^11 + 273077734735872000*x^8*y*A^14*B^12 + 4594679599417262080*x^9*y*A^12*B^13 + 31125678161745936384*x^10*y*A^10*B^14 + 123117193303664099328*x^11*y*A^8*B^15 + 274046860970139058176*x^12*y*A^6*B^16 + 480054757165734297600*x^13*y*A^4*B^17 + 106481850717453680640*x^14*y*A^2*B^18 + 4199787797063663616*x^15*y*B^19 - 16818176*y*A^27*B^6 - 1760722944*x*y*A^25*B^7 - 166601687040*x^2*y*A^23*B^8 - 1334003630080*x^3*y*A^21*B^9 + 219551448956928*x^4*y*A^19*B^10 + 4111320307728384*x^5*y*A^17*B^11 + 12724434527846400*x^6*y*A^15*B^12 + 115656208102195200*x^7*y*A^13*B^13 + 3186954974999347200*x^8*y*A^11*B^14 + 23539935184167108608*x^9*y*A^9*B^15 + 91160840991160664064*x^10*y*A^7*B^16 + 187077951477698789376*x^11*y*A^5*B^17 + 242726701919937495040*x^12*y*A^3*B^18 + 25709943614204805120*x^13*y*A*B^19 - 460062720*y*A^24*B^8 - 53262417920*x*y*A^22*B^9 - 1890846769152*x^2*y*A^20*B^10 + 66006584131584*x^3*y*A^18*B^11 + 2818679343415296*x^4*y*A^16*B^12 + 19346003727482880*x^5*y*A^14*B^13 + 40781245977722880*x^6*y*A^12*B^14 + 1658369078659645440*x^7*y*A^10*B^15 + 15596590281296707584*x^8*y*A^8*B^16 + 57784096306501779456*x^9*y*A^6*B^17 + 110951883285620326400*x^10*y*A^4*B^18 + 87860583293371023360*x^11*y*A^2*B^19 + 2928887870162731008*x^12*y*B^20 - 9873391616*y*A^21*B^10 - 759806558208*x*y*A^19*B^11 + 2724653432832*x^2*y*A^17*B^12 + 1163786887102464*x^3*y*A^15*B^13 + 16730143158435840*x^4*y*A^13*B^14 + 40940281100500992*x^5*y*A^11*B^15 + 577495066327646208*x^6*y*A^9*B^16 + 8576938639437594624*x^7*y*A^7*B^17 + 32248589731007299584*x^8*y*A^5*B^18 + 52815667761847992320*x^9*y*A^3*B^19 + 20059617680494166016*x^10*y*A*B^20 - 136885305344*y*A^18*B^12 - 4346439794688*x*y*A^16*B^13 + 246568703754240*x^2*y*A^14*B^14 + 8414317674233856*x^3*y*A^12*B^15 + 47101454636285952*x^4*y*A^10*B^16 + 137934523978481664*x^5*y*A^8*B^17 + 3536050010770636800*x^6*y*A^6*B^18 + 16176262457956761600*x^7*y*A^4*B^19 + 18046515244129320960*x^8*y*A^2*B^20 + 2148489701139415040*x^9*y*B^21 - 1101659111424*y*A^15*B^14 + 10282151706624*x*y*A^13*B^15 + 2331342608007168*x^2*y*A^11*B^16 + 30002236348170240*x^3*y*A^9*B^17 + 63708452492410880*x^4*y*A^7*B^18 + 953421716816658432*x^5*y*A^5*B^19 + 6913346485409021952*x^6*y*A^3*B^20 + 3774104448666697728*x^7*y*A*B^21 - 4329327034368*y*A^12*B^16 + 285735584268288*x*y*A^10*B^17 + 10101763080192000*x^2*y*A^8*B^18 + 48873291854643200*x^3*y*A^6*B^19 + 153338991121268736*x^4*y*A^4*B^20 + 2193631250529386496*x^5*y*A^2*B^21 + 349222485167702016*x^6*y*B^22 + 1616282092830720*x*y*A^7*B^19 + 20734590276599808*x^2*y*A^5*B^20 + 32422398879858688*x^3*y*A^3*B^21 + 428756758274506752*x^4*y*A*B^22 + 69269232549888*y*A^6*B^20 + 4033008650682368*x*y*A^4*B^21 + 15252425300508672*x^2*y*A^2*B^22 + 37788015623405568*x^3*y*B^23 + 246290604621824*y*A^3*B^22 + 3799912185593856*x*y*A*B^23 + 281474976710656*y*B^24
In [ ]: