# Compute Q from p following the construction of Mestre restart; f:=x->(x+r1)*(x+r2)*(x+r3)*(x+r4)*(x+r5)*(x+r6); p:=f(x-t)*f(x+t); Q:=x^6+a0*x^5+a1*x^4+a2*x^3+a3*x^2+a4*x+a5; a0:=solve(coeff(expand(p-Q^2),x,11),a0): a1:=solve(coeff(expand(p-Q^2),x,10),a1): a2:=solve(coeff(expand(p-Q^2),x,9),a2): a3:=solve(coeff(expand(p-Q^2),x,8),a3): a4:=solve(coeff(expand(p-Q^2),x,7),a4): a5:=solve(coeff(expand(p-Q^2),x,6),a5): rr:=expand(p-Q^2): expand(Q^2+rr-p); r1:=17;r2:=16;r3:=-10;r4:=-11;r5:=-14;r6:=-17;