/////////////////////////////////////////////////////////////////////////////////////////////////////
//Verifying r=3 case in Theorem 6.1

P<t>:=PolynomialRing(Rationals());

f3:=t^9+2973*t^6-369249*t^3+11764900;

C3:=HyperellipticCurve(P!f3);
F3<u,y>:=FunctionField(C3);

y31:=u^6-106*u^3+3430;
y32:=1/64*u^6 +269/4*u^3+3430;
y33:=u^6+36*u^5+486*u^4+3350*u^3+13914*u^2+33264*u+40474;

D31:=PrincipalDivisor(y-y31) div 3;
D32:=PrincipalDivisor(y-y32) div 3;
D33:=PrincipalDivisor(y-y33) div 3;


IsPrincipal(3*D31);
IsPrincipal(3*D32);
IsPrincipal(3*D33);

for i1,i2,i3 in [0..2] do
D:=i1*D31+i2*D32+i3*D33;
if IsPrincipal(D) then
i1,i2,i3;
end if;
end for;