PP(r,r,i), PP(r,r,i,j), etc., everything coprime except r,r. We can use these to calculate the contr. of a pure curve of 1/r(i,j). The answer should be an ice cream function, with the main ingredients derived from things like InverseMod(ph(i), ph(r)) function ph(r); return (1-t^r) div (1-t); end function; // i = 1 mod r. It works for all r r:=7; a:=17; i:=1; j:=2*r*a+i; A:=[r,r,j]; kP := -&+A; X:=1/Denom(A)-Qorb(j,[r,r],kP); // e.g. [6,6,10-5], [ 7, 7, 239 ] etc. X-Qorb(r,[j],kP+r)/(1-t^r) -a*((1-t^(r-2)) div (1-t))*t^2/t^((a+1)*r)/Denom([1,1,r]); // i = -1 mod r. It works for all r r:=11; a:=17; i:=2*r-1; j:=2*r*a+i; A:=[r,r,j]; kP := -&+A; X:=1/Denom(A)-Qorb(j,[r,r],kP); X-Qorb(r,[j],kP+r)/(1-t^r)-(a+1)*((1-t^(r-2)) div (1-t))*t^2/t^((a+2)*r-1)/Denom([1,1,r]); // i = 2 mod r. This works for all odd r r:=11; a:=17; i:=2; j:=2*r*a+i; A:=[r,r,j]; kP := -&+A; X:=1/Denom(A)-Qorb(j,[r,r],kP); X-Qorb(r,[j],kP+r)/(1-t^r) +((&*[1-(-t)^a : a in L] div (1-t^2) where L:=[(r+1) div 2, (r-1) div 2]) +a*(((r-2)*(1-t^(r+1))+(r-1)*(t-t^r)-(t^2-t^(r-1))) div ((1-t^2)*(1+t))))/t^((a+1)*r-1)/Denom([1,1,r]); // better: that crazy term &*[ L] is InverseMod .. r:=13; a:=17; i:=2; j:=2*r*a+i; A:=[r,r,j]; kP := -&+A; X:=1/Denom(A)-Qorb(j,[r,r],kP); X-Qorb(r,[j],kP+r)/(1-t^r) +(InverseMod((-t)^((r+1) div 2)*ph(2),ph(r)) +a*(((r-2)*(1-t^(r+1))+(r-1)*(t-t^r)-(t^2-t^(r-1))) div ((1-t^2)*(1+t))))/t^((a+1)*r-1)/Denom([1,1,r]); // i = -2 mod r. This works for all odd r r:=13; a:=3; i:=2*r-2; j:=2*r*a+i; A:=[r,r,j]; kP := -&+A; X:=1/Denom(A)-Qorb(j,[r,r],kP); X-Qorb(r,[j],kP+r)/(1-t^r) -((&*[1-(-t)^a : a in L] div (1-t^2) where L:=[(r+1) div 2, (r-1) div 2])-(a+1)*(((r-2)*(1-t^(r+1))+(r-1)*(t-t^r)-(t^2-t^(r-1))) div ((1-t^2)*(1+t))))/t^((a+2)*r-3)/Denom([1,1,r]); // i = 3 mod r. This works for r coprime to 3, but peculiar case division. r:=17; a:=1; i:=3; j:=2*r*a+i; A:=[r,r,j]; kP := -&+A; X:=1/Denom(A)-Qorb(j,[r,r],kP); X-Qorb(r,[j],kP+r)/(1-t^r) +(1+ep*t^(((r+be) div 2)))*(1-ep*t^(((r-be) div 2)))/t^((a+1)*r-1)/(1-t^3)/Denom([1,1,r]) where be is 2-(r mod 2) where ep is (-1)^((r mod 6) div 3); // i = 3 mod r, works for r odd r:=25; a:=0; i:=3; j:=2*r*a+i; A:=[r,r,j]; kP := -&+A; X:=1/Denom(A)-Qorb(j,[r,r],kP); X-Qorb(r,[j],kP+r)/(1-t^r) -(-1)^((r mod 6) div 3)*InverseMod(t^((r+1) div 2)*ph(3),ph(r))/t^(r*(a+1)-1)/Denom([1,1,r]) +a*quot(1+t^3,t*ph(3)^2,r)/t^(r*(a+1)-1)/Denom([1,1,r]); // i = 3 mod r, works for r even r:=16; a:=5; i:=3; j:=2*r*a+i; A:=[r,r,j]; kP := -&+A; X:=1/Denom(A)-Qorb(j,[r,r],kP); X-Qorb(r,[j],kP+r)/(1-t^r) -(-1)^((r mod 6) div 3)*((1+t)*InverseMod(t^((r+2) div 2)*ph(3),ph(r)) mod ph(r))/t^(r*(a+1)-1)/Denom([1,1,r]) +a*quot(1+t^3,t*ph(3)^2,r)/t^(r*(a+1)-1)/Denom([1,1,r]); Both of these work, with the only problem to reconcile InverseMod(t^((r+1) div 2)*ph(3),ph(r)) for r odd with (1+t)*InverseMod(t^((r+2) div 2)*ph(3),ph(r)) mod ph(r) for r even Maybe there is a more systematic solution. Another problem is to write the functions for i = ±1, ±2 in the InverseMod form, and to deal with the case division in the ±2 case. ======================== I'm nearly ready for the general PP(r,r,i). When i == 2 mod r we know the contr is a sum of two bits, each of which has two alternative descriptions BB = ((&*[1-(-t)^a : a in L] div (1-t^2) where L:=[(r+1) div 2, (r-1) div 2])/t^((a+1)*r-1))/Denom([1,1,r]); InverseMod((-t)^((r+1) div 2)*ph(2),ph(r)); two geometric progressions from each end. +a*AA where AA = (((r-2)*(1-t^(r+1))+(r-1)*(t-t^r)-(t^2-t^(r-1))) div ((1-t^2)*(1+t))))/t^((a+1)*r-1)/Denom([1,1,r]); = (1+t^2)*InverseMod(t*ph(2)^2,ph(r)) mod ph(r) // i: = 2. This works for all odd r and a r:=31; a:=9; i:=2; j:=2*r*a+i; A:=[r,r,j]; kP := -&+A; X:=1/Denom(A)-Qorb(j,[r,r],kP); X-Qorb(r,[j],kP+r)/(1-t^r) +(InverseMod((-t)^((r+1) div 2)*ph(i),ph(r)) +a*((1+t^i)*InverseMod(t*ph(i)^2,ph(r)) mod ph(r)))/t^((a+1)*r-1)/Denom([1,1,r]); // i: = 3. Same function covers r == 1,11 mod 12 r:=37; a:=9; i:=3; j:=2*r*a+i; A:=[r,r,j]; kP := -&+A; X:=1/Denom(A)-Qorb(j,[r,r],kP); X-Qorb(r,[j],kP+r)/(1-t^r) +(+InverseMod((-t)^((r+1) div 2)*ph(i),ph(r)) +a*((1+t^i)*InverseMod(t*ph(i)^2,ph(r)) mod ph(r)))/t^((a+1)*r-1)/Denom([1,1,r]); // i: = 3. This works for r == 5,7 mod 12. Problem only in 2nd term sign? r:=17; a:=9; i:=3; j:=2*r*a+i; A:=[r,r,j]; kP := -&+A; X:=1/Denom(A)-Qorb(j,[r,r],kP); X-Qorb(r,[j],kP+r)/(1-t^r) +(-InverseMod((-t)^((r+1) div 2)*ph(i),ph(r)) +a*((1+t^i)*InverseMod(t*ph(i)^2,ph(r)) mod ph(r)))/t^((a+1)*r-1)/Denom([1,1,r]); X-Qorb(r,[j],kP+r)/(1-t^r) +(InverseMod(t^14*ph(InverseMod(i,r)),ph(r)) +a*((1+t^i)*InverseMod(t^(r-i)*ph(InverseMod(i,r))^2,ph(r)) mod ph(r)))/t^((a+1)*r-1)/Denom([1,1,r]); AA := (1+t^2)*InverseMod(t*ph(2)^2,ph(r)) mod ph(r); ======================== Try PP(r,r,a*r+2,b*r+2) with a, b chosen to make (r,a*r+2,b*r+2) pairwise coprime. r:=33; a:=0; b:=1; A := [r,r,a*r+2,b*r+2]; kP := -&+A; X:=1/Denom(A)-Qorb(a*r+2,[r,r,b*r+2],kP)-Qorb(b*r+2,[r,r,a*r+2],kP)-Qorb(r,[a*r+2,b*r+2],kP+r)/(1-t^r) ; // This X depends only on a+b, not on a,b themselves (provided coprime). This looks like a double-cone ice cream: -150*t^11-136*t^9-108*t^7-63*t^5-28*t^3-7*t -7*t^10-28*t^8-63*t^6-108*t^4-136*t^2-150 x3 eq 3*xx - 33*BB; r:=33; a:=0; b:=1; A := [r,r,a*r+2,b*r+2]; kP := -&+A; X:=1/Denom(A)-Qorb(a*r+2,[r,r,b*r+2],kP) -Qorb(b*r+2,[r,r,a*r+2],kP) -Qorb(r,[a*r+2,b*r+2],kP+r)/(1-t^r); xx := Numerator(X); r:=33; a:=0; b:=3; A := [r,r,a*r+2,b*r+2]; kP := -&+A; X:=1/Denom(A)-Qorb(a*r+2,[r,r,b*r+2],kP) -Qorb(b*r+2,[r,r,a*r+2],kP) -Qorb(r,[a*r+2,b*r+2],kP+r)/(1-t^r); x3 := Numerator(X); x3-3*xx; BB := InverseMod(t^17*ph(2),ph(r)); x3 eq 3*xx - 33*BB; BB eq - &*[1-(-t)^a : a in L] div (1-t^2) where L:=[(r+1) div 2, (r-1) div 2]; xx eq 152*BB + (t*InverseMod(t^17*ph(2)^2,ph(33))-136*t^16)/(1+t); r = 11 -> t^11 + t^9 + t^7 + t^4 + t^2 + 1 "double cone" ice cream. This is -InverseMod(ph(2)*t^7,ph(13)); similarly r = 33 -> t^31 + t^29 + t^27 + t^25 + t^23 + t^21 + t^19 + t^17 + t^14 + t^12 + t^10 + t^8 + t^6 + t^4 + t^2 + 1 which is -InverseMod(ph(2)*t^17,ph(33)). (But beware the look-alike InverseMod(ph(2)*t^16,ph(33)): > InverseMod(ph(2)*t^16,ph(33))+InverseMod(ph(2)*t^17,ph(33)); t^16 // !) IsIrreducible((xx-InverseMod(ph(2)*t^17,ph(33))) div (1+t)); Testing routine: for x in [1..10] do r:=6*Random(15)+Random([4,8]); a:=Random([1..5]); i:=3; j:=2*r*a+i; A:=[r,r,j]; kP := -&+A; X:=1/Denom(A)-Qorb(j,[r,r],kP); X-Qorb(r,[j],kP+r)/(1-t^r) -(-1)^((r mod 6) div 3)*((1+t)*InverseMod(t^((r+2) div 2)*ph(3),ph(r)) mod ph(r))/t^(r*(a+1)-1)/Denom([1,1,r]) +a*quot(1+t^3,t*ph(3)^2,r)/t^(r*(a+1)-1)/Denom([1,1,r]); end for; 4 -> a * (1+t) 5 -> a * (2*t^2 - t + 2)/t^(2*a*r-1)/Denom([1,1,r]) 7 -> a * (3*t^4 + t^3 + t + 3)/t^(2*a*r-1)/Denom([1,1,r]) 8 -> a * (4*t^5 - t^4 + 2*t^3 + 2*t^2 - t + 4)/t^(2*a*r-1)/Denom([1,1,r]) 10 -> a * (5*t^7 + t^6 + 3*t^4 + 3*t^3 + t + 5)/t^(2*a*r-1)/Denom([1,1,r]) 11 -> 6*t^8 - t^7 + 2*t^6 + 4*t^5 - t^4 + 4*t^3 + 2*t^2 - t + 6 13 -> 7*t^10 + t^9 + 5*t^7 + 3*t^6 + 3*t^4 + 5*t^3 + t + 7 14 -> -8*t^11+t^10-2*t^9-6*t^8+t^7-4*t^6-4*t^5+t^4-6*t^3-2*t^2+t-8 = -8*t^11-6*t^8-4*t^5-2*t^2 +t^10+t^7+t^4+t -2*t^9-4*t^6-6*t^3-8 -2*(4-5*t^3+t^15)/(1-t^3)^2 + t*(1-t^12)/(1-t^3) - 2*t^2*(1-5*t^12+4*t^15)/(1-t^3)^2; 16 -> -9*t^13-t^12-7*t^10-3*t^9-5*t^7-5*t^6-3*t^4-7*t^3-t-9 = -9*t^13-7*t^10-5*t^7-3*t^4-t + -t^12-3*t^9-5*t^6-7*t^3-9 = [ -t*(1+t^3-11*t^15+9*t^18) -(9-11*t^3+t^15+t^18) ] /(1-t)^3 17 -> -10*t^14+t^13-2*t^12-8*t^11+t^10-4*t^9-6*t^8+t^7-6*t^6-4*t^5+t^4-8*t^3-2*t^2+t-10 = -10*t^14-8*t^11-6*t^8-4*t^5-2*t^2 +t^13+t^10+t^7+t^4+t -2*t^12-4*t^9-6*t^6-8*t^3-10 ( 2*(5-6*t^3+t^18)/(1-t^3)^2 +2*(1-6*t^15+5*t^18)*t^2/(1-t^3)^2 -(1-t^15)*t/(1-t^3) )/t^(2*a*r-1)/Denom([1,1,r]); N.B. that quantity is really (1+t^3)/ph(3)^2 mod ph(17) > Numerator(Qorb(17,[3,3],11)*(1+t^3)/t) mod ph(17); -10*t^14 + t^13 - 2*t^12 - 8*t^11 + t^10 - 4*t^9 - 6*t^8 + t^7 - 6*t^6 - 4*t^5 + t^4 - 8*t^3 - 2*t^2 + t - 10 Useful fact: r = 15 -> -t^15 - t^8 + t^7 + 1 r = 17 -> -t^17 + t^9 - t^8 + 1 div (1-t^2) = (1-t^8)*(1+t^9) r = 19 -> -t^19 - t^10 + t^9 + 1 div (1-t^2) = (1+t^9)*(1-t^10) r = 21 -> -t^21 + t^11 - t^10 + 1 = (1-t^10)*(1+t^11) r = 23 -> -t^23 - t^12 + t^11 + 1 = (1+t^11)*(1-t^12) r = 29 -> -t^29 + t^15 - t^14 + 1 = (1-t^14)*(1+t^15) &*[1-(-t)^a : a in L] where L:=[(r+1) div 2, (r-1) div 2] Testing routine: for x in [1..10] do r:=3+2*Random(15); a:=2+Random(15); i:=2*r-2; j:=2*r*a+i; A:=[r,r,j]; kP := -&+A; X:=1/Denom(A)-Qorb(j,[r,r],kP); X-Qorb(r,[j],kP+r)/(1-t^r) -((&*[1-(-t)^a : a in L] div (1-t^2) where L:=[(r+1) div 2, (r-1) div 2])-(a+1)*(((r-2)*(1-t^(r+1))+(r-1)*(t-t^r)-(t^2-t^(r-1))) div ((1-t^2)*(1+t))))/t^((a+2)*r-3)/Denom([1,1,r]) eq 0; end for; for x in [1..10] do r:=4+2*Random(15); a:=2+Random(15); i:=2*r-1; j:=2*r*a+i; A:=[r,r,j]; kP := -&+A; X:=1/Denom(A)-Qorb(j,[r,r],kP); X-Qorb(r,[j],kP+r)/(1-t^r)-(a+1)*((1-t^(r-2)) div (1-t))*t^2/t^((a+2)*r-1)/Denom([1,1,r]); end for; r:=13; i:=3; a:=3; j:=2*r*a+i; A:=[r,r,j]; kP := -&+A; X:=1/Denom(A)-Qorb(j,[r,r],kP); X-Qorb(r,[j],kP+r)/(1-t^r) -((&*[1-(-t)^a : a in L] div (1-t^2) where L:=[(r+1) div 2, (r-1) div 2])-(a+1)*(((r-2)*(1-t^(r+1))+(r-1)*(t-t^r)-(t^2-t^(r-1))) div ((1-t^2)*(1+t))))/t^((a+2)*r-3)/Denom([1,1,r]); r = 7 -> 1+t^4 r = 8 -> t^4 - t^3 + t^2 - t + 1 = (1+t^5)/(1+t) r = 10 -> t^6 - t^5 + t^4 + t^2 - t + 1 = (1-t+t^2)*(1+t^4) = (1+t^3)*(1+t^4)/(1+t) r = 11 -> t^8 + t^5 + t^3 + 1 = (1+t^3)*(1+t^5) r = 13 -> t^10 + t^7 + t^3 + 1 = (1+t^3)*(1+t^7) r = 14 -> t^10 - t^9 + t^8 + t^2 - t + 1 = (1-t+t^2)*(1+t^8) = (1+t^3)*(1+t^8)/(1+t) r = 16 -> t^12 - t^11 + t^10 + t^6 + t^2 - t + 1 = (t^6+t^3+1)*(t^6-t^5+t^4-t^3+t^2-t+1) = (1+t^7)*(1-t^9)/(1+t)/(1-t^3) r = 17 -> t^14 + t^11 + t^8 + t^6 + t^3 + 1 = (1+t^3+t^6)*(1+t^8) r = 19 -> t^16 + t^13 + t^10 + t^6 + t^3 + 1 = (1+t^3+t^6)*(1+t^10) = (1-t^9)*(1+t^10)/(1-t^3) r = 20 -> t^16 - t^15 + t^14 + t^10 - t^9 + t^8 - t^7 + t^6 + t^2 - t + 1 = (t^6+t^3+1)*(t^10-t^9+t^8-t^7+t^6-t^5+t^4-t^3+t^2-t+1) = (1+t^11)(1-t^9)/(1+t)/1-t^3) r = 22 -> t^18-t^17+t^16+t^12-t^11+t^10+t^8-t^7+t^6+t^2-t+1 = (1-t+t^2)*(1+t^6)*(1+t^10) r = 23 -> t^20+t^17+t^14+t^11+t^9+t^6+t^3+1 = (1+t^11)*(1-t^12)/(1-t^3) r = 25 -> t^22+t^19+t^16+t^13+t^9+t^6+t^3+1 = (1+t^13)*(1-t^12)/(1-t^3) r = 26 -> t^22-t^21+t^20+t^16-t^15+t^14+t^8-t^7+t^6+t^2-t+1 = (1-t+t^2)(1+t^6)(1+t^14) = (1+t^3)(1+t^6)(1+t^14)/(1+t) ?? guess what's going on. When r is odd (1 + t^(r/2))*(1 - t^(r/2))/(1-t^3) with + or - r/2 dep on r mod 6? r = 7 -> 1+t^4 r = 13 -> t^10 + t^7 + t^3 + 1 = (1+t^3)*(1+t^7) = (1+t^7) * (1-t^6)/(1-t^3) r = 19 -> t^16 + t^13 + t^10 + t^6 + t^3 + 1 = (1+t^3+t^6)*(1+t^10) = (1+t^10)*(1-t^9)/(1-t^3) r = 25 -> t^22+t^19+t^16+t^13+t^9+t^6+t^3+1 = (1+t^13) * (1-t^12)/(1-t^3) r = 31 -> (1+t^16) * (1-t^15)/(1-t^3) r = 37 -> (1+t^19) * (1-t^18)/(1-t^3) r = 43 -> (1+t^22) * (1-t^21)/(1-t^3) gives (1+t^((r+1) div 2))*(1-t^((r-1) div 2)) &*[1 + t^(((r+1) div 2)), 1 - t^(((r-1) div 2))]/t^(r-1)/(1-t^3); // If 1 mod 6 r = 5 -> (1+t^2) r = 11 -> (1+t^5) * (1+t^3) = (1+t^5) * (1-t^6)/(1-t^3) r = 17 -> (t^14 + t^11 + t^8 + t^6 + t^3 + 1) = (1+t^8) * (1-t^9)/(1-t^3) &*[1 - t^(((r+1) div 2)), 1 + t^(((r-1) div 2))]/t^(r-1)/(1-t^3); // If 5 mod 6 r = 4 -> (1+t) * (1-t^4) r = 10 -> (1+t^4) * (1-t^6)/(1-t^3) r = 16 -> (1+t^7) * (1-t^9)/(1-t^3) r = 22 -> (1+t^10) * (1-t^12)/(1-t^3) gives (1+t^((r-2) div 2))*(1-t^((r+2) div 2)/(1-t^3) // if 4 mod 6 r = 8 -> (1+t^5) r = 14 -> (1+t^8) * (1-t^6)/(1-t^3) r = 20 -> (1+t^11) * (1-t^9)/(1-t^3) gives (1-t^((r-2) div 2))*(1+t^((r+2) div 2)/(1-t^3) In either case, a prod of 2 terms (1 ± t^(r±1 or ±2/2))/(1-t^3) &*[1-(-t)^a : a in L] where L:=[(r+1) div 2, (r-1) div 2] [ 1 - (-1)^r * t^(((r - (-1)^r*2) div 2)), 1 + (-1)^r * t^(((r - (-1)^r*2) div 2)), 1 - (-1)^r * t^(((r + (-1)^r*2) div 2)), 1 + (-1)^r * t^(((r + (-1)^r*2) div 2)) ]; b = 1 if r odd b = 2 if r even [ 1 - (-1)^r * t^(((r - (-1)^r*2 * b) div 2)), 1 + (-1)^r * t^(((r - (-1)^r*2 * b) div 2)), 1 - (-1)^r * t^(((r + (-1)^r*2 * b) div 2)), 1 + (-1)^r * t^(((r + (-1)^r*2 * b) div 2)) ] where b is ((3 + (-1)^r) div 2); + goes with the bigger one if i is 1 or 2 mod 6 (r mod 6) div 3 (1 + (-1)^a * t^(((r+b) div 2)))*(1 - (-1)^a * t^(((r-b) div 2))) /t^(r-1)/(1-t^3)/Denom([1,1,r]) where b is 2 - (r mod 2) where a is (r mod 6) div 3; r:=33; A := [r,r,1,1,2,101]; kP := -&+A; X := 1/Denom(A) - Qorb(2,[r,r,1,1,101],kP) - Qorb(101,[r,r,1,1,2],kP) - Qorb(r,[1,1,2,101],kP+r)/(1-t^r); xx := Numerator(X); A:=[ 33, 33, 1, 2, 35 ]; xx*ph(2)^3 mod ph(r) + 16*t^16*(1+t)^2 + t^17; A := [r,r,1,1,2,35]; kP := -&+A; xx*ph(2)^3 mod ph(r) - 16*t^16*(1+t)^2 - t^17; A := [r,r,1,1,2,101]; xx*ph(2)^3 mod ph(r) - 15*t^16*(1+t)^2 - 3*t^17; A := [r,r,1,2,101]; kP := -&+A; X := 1/Denom(A) - Qorb(2,[r,r,1,101],kP) - Qorb(101,[r,r,1,2],kP) - Qorb(r,[1,2,101],kP+r)/(1-t^r); xx := Numerator(X); xx*ph(2)^3 mod ph(r) + 15*t^16*(1+t)^2 + 3*t^17; r:=37; A := [r,r,1,1,1]; kP := -&+A; X := 1/Denom(A) - Qorb(r,[1,1,1],kP+r)/(1-t^r); // gives 0 r:=37; A := [r,r,1,1,38]; kP := -&+A; X := 1/Denom(A) - Qorb(38,[r,r,1,1],kP) - Qorb(r,[1,1,38],kP+r)/(1-t^r); /still 0 r:=37; a:=0; b:= 0; c:=101; A := [r,r,r*a+1,r*b+1,r*c+1]; kP := -&+A; X := 1/Denom(A) - Qorb(A[3],A[[1,2,4,5]],kP) - Qorb(A[4],A[[1,2,3,5]],kP) - Qorb(A[5],A[[1,2,3,4]],kP) - Qorb(r,A[[3,4,5]],kP+r)/(1-t^r); // gives -((c-1) div 2)*(1-t^2) div (1+t))/[1,1,1,1,r] if c odd // -(c div 2)*((1-t^35) div (1-t))/[1,1,1,1,r] if c even r:=37; a:=0; b:= 2; c:=100; A := [r,r,r*a+1,r*b+1,r*c+1]; kP := -&+A; X := 1/Denom(A) - Qorb(A[3],A[[1,2,4,5]],kP) - Qorb(A[4],A[[1,2,3,5]],kP) - Qorb(A[5],A[[1,2,3,4]],kP) - Qorb(r,A[[3,4,5]],kP+r)/(1-t^r); // gives -((b+c-1) div 2)*(1-t^2) div (1+t))/[1,1,1,1,r] if c odd // -((b+c) div 2)*((1-t^35) div (1-t))/[1,1,1,1,r] if c even r:=37; a:=2; b:= 4; c:=6; A := [r,r,r*a+1,r*b+1,r*c+1]; kP := -&+A; X := 1/Denom(A) - Qorb(A[3],A[[1,2,4,5]],kP) - Qorb(A[4],A[[1,2,3,5]],kP) - Qorb(A[5],A[[1,2,3,4]],kP) - Qorb(r,A[[3,4,5]],kP+r)/(1-t^r); // gives -((a+b+c-1) div 2)*(1-t^2) div (1+t))/[1,1,1,1,r] if c odd // -((a+b+c) div 2)*((1-t^35) div (1-t))/[1,1,1,1,r] if c even r:=37; a:=1; b:= 1; c:=6; A := [r,r,a,b,c]; if GCD(a,b) + GCD(a,c) + GCD(b,c) ne 3 then error "Not coprime"; end if; kP := -&+A; > A; [ 37, 37, 1, 5, 6 ] > xx*ph(5)*ph(6) mod ph(r) + t^19*ph(3)*ph(5) - t^21*(1+t^2); 0 > A; [ 37, 37, 1, 1, 5 ] > xx; t^31 + t^25 + t^19 + t^12 + t^6 + 1 > xx*ph(6) mod ph(r); -t^18 > InverseMod(t^19*ph(6),ph(r)); -t^31 - t^25 - t^19 - t^12 - t^6 - 1 > a:=1; b:= 1; c:=1; A := [r,r,a,b,c]; if GCD(a,b) + GCD(a,c) + GCD(b,c) ne 3 then error "Not coprime"; end if; kP := -&+A; > X := 1/Denom(A) - Qorb(A[3],A[[1,2,4,5]],kP) - Qorb(A[4],A[[1,2,3,5]],kP) - Qorb(A[5],A[[1,2,3,4]],kP) - Qorb(r,A[[3,4,5]],kP+r)/(1-t^r); > X; 0 > A; [ 37, 37, 1, 1, 2 ] > xx; -t^35 - t^33 - t^31 - t^29 - t^27 - t^25 - t^23 - t^21 - t^19 - t^16 - t^14 - t^12 - t^10 - t^8 - t^6 - t^4 - t^2 - 1 > xx*ph(c) mod ph(r); // t^36 t^18 > xx eq t^18*InverseMod(ph(c), ph(r)) mod ph(r); true > A; [ 37, 37, 1, 1, 3 ] > xx; -t^34 - t^31 - t^28 - t^25 - t^22 - t^19 - t^15 - t^12 - t^9 - t^6 - t^3 - 1 > xx*ph(c) mod ph(r); // t^36 t^18 > xx eq t^18*InverseMod(ph(c), ph(r)) mod ph(r); true > A; [ 37, 37, 1, 1, 4 ] > xx; -t^33 - t^29 - t^25 - t^21 - t^17 - t^16 - t^12 - t^8 - t^4 - 1 > xx*ph(c) mod ph(r); // t^36 -t^19 - t^18 - t^17 > xx eq -t^17*((1-t^3) div (1-t))*InverseMod(ph(c),ph(r)) mod ph(r); true > A; [ 37, 37, 1, 1, 5 ] > xx; // t^37 t^34 - t^33 + t^32 + t^29 - t^28 + t^27 + t^24 - t^23 + t^22 + t^19 - t^18 + t^17 - t^16 + t^15 + t^12 - t^11 + t^10 + t^7 - t^6 + t^5 + t^2 - t + 1 > xx*ph(c) mod ph(r); -t^20 - t^18 > xx eq -t^18*(1+t^2)*InverseMod(ph(c), ph(r)) mod ph(r); true > A; [ 37, 37, 1, 1, 6 ] > xx; -t^31 - t^25 - t^19 - t^12 - t^6 - 1 > xx*ph(c) mod ph(r); t^18 > xx eq t^18*InverseMod(ph(c), ph(r)) mod ph(r); true > A; [ 37, 37, 1, 1, 7 ] > xx; -t^34 + t^33 - 2*t^32 + t^31 - t^30 - t^27 + t^26 - 2*t^25 + t^24 - t^23 - t^20 + t^19 - 2*t^18 + t^17 - 2*t^16 + t^15 - t^14 - t^11 + t^10 - 2*t^9 + t^8 - t^7 - t^4 + t^3 - 2*t^2 + t - 1 > xx*ph(c) mod ph(r); -t^22 - t^20 - t^18 > xx eq -t^18*(1+t^2+t^4)*InverseMod(ph(c),ph(r)) mod ph(r); true > A; [ 37, 37, 1, 1, 8 ] > xx; -2*t^35 - t^34 - 3*t^32 - t^30 - 2*t^29 - 2*t^27 - t^26 - 3*t^24 - t^22 - 2*t^21 - 2*t^19 - t^18 - t^17 - 2*t^16 - 2*t^14 - t^13 - 3*t^11 - t^9 - 2*t^8 - 2*t^6 - t^5 - 3*t^3 - t - 2 > xx*ph(c) mod ph(r); -t^24 - t^21 - t^18 > xx eq -t^18*(1+t^3+t^6)*InverseMod(ph(c), ph(r)) mod ph(r); true > A; [ 37, 37, 1, 1, 9 ] > xx; -t^28 - t^19 - t^9 - 1 > xx*ph(c) mod ph(r); t^18 > xx eq t^18*InverseMod(ph(c), ph(r)) mod ph(r); true > A; [ 37, 37, 1, 1, 10 ] > xx; -t^35 - 2*t^34 - 3*t^31 - 2*t^28 - t^27 - t^25 - 2*t^24 - 3*t^21 - 2*t^18 - 2*t^17 - 3*t^14 - 2*t^11 - t^10 - t^8 - 2*t^7 - 3*t^4 - 2*t - 1 > xx*ph(c) mod ph(r); // t^40 -t^26 - t^25 - t^23 - t^22 - t^21 - t^19 - t^18 > xx*ph(c) mod ph(r) eq -t^18*((1-t^9) div (1-t) - (t^2+t^6)); true > xx eq -t^18*(1+t+t^3+t^4+t^5+t^7+t^8)*InverseMod(ph(c), ph(r)) mod ph(r); true > A; [ 37, 37, 1, 1, 11 ] > xx; -2*t^34 - t^33 - 3*t^30 - t^27 - 2*t^26 - 2*t^23 - t^22 - 3*t^19 - 3*t^15 - t^12 - 2*t^11 - 2*t^8 - t^7 - 3*t^4 - t - 2 > xx*ph(c) mod ph(r); // t^40 t^26 + t^22 + t^18 > xx eq t^18*(1+t^4+t^8)*InverseMod(ph(c), ph(r)) mod ph(r); true > A; [ 37, 37, 1, 1, 12 ] > xx; -t^25 - t^13 - t^12 - 1 > xx*ph(c) mod ph(r); -t^23 - t^22 - t^21 - t^20 - t^19 - t^18 - t^17 - t^16 - t^15 - t^14 - t^13 > xx eq -((1-t^11) div (1-t)) * InverseMod(t^24*ph(c), ph(r)) mod ph(r); true > A; [ 37, 37, 1, 1, 13 ] > xx; t^34 - t^33 + 2*t^32 - 2*t^31 + 3*t^30 - 3*t^29 + 3*t^28 - 2*t^27 + 2*t^26 - t^25 + t^24 + t^21 - t^20 + 2*t^19 - 2*t^18 + 3*t^17 - 2*t^16 + 2*t^15 - t^14 + t^13 + t^10 - t^9 + 2*t^8 - 2*t^7 + 3*t^6 - 3*t^5 + 3*t^4 - 2*t^3 + 2*t^2 - t + 1 > xx*ph(c) mod ph(r); // t^41 t^28 + t^26 + t^24 + t^22 + t^20 + t^18 > xx eq t^18*((1-t^12) div (1-t^2)) * InverseMod(ph(c), ph(r)) mod ph(r); true > A; [ 37, 37, 1, 1, 14 ] > xx; -2*t^33 - t^32 - 3*t^28 - t^24 - 2*t^23 - 2*t^19 - t^18 - t^15 - 2*t^14 - 2*t^10 - t^9 - 3*t^5 - t - 2 > xx*ph(c) mod ph(r); // t^41 -t^28 - t^23 - t^18 > xx eq -(1+t^5+t^10) * InverseMod(t^19*ph(c), ph(r)) mod ph(r); true > A; [ 37, 37, 1, 1, 15 ] > xx; t^34 + t^33 + t^32 + t^31 + t^30 + t^29 - t^28 + t^27 + t^26 + t^25 + t^24 + t^23 + t^22 + t^19 + t^18 + t^17 + t^16 + t^15 + t^12 + t^11 + t^10 + t^9 + t^8 + t^7 - t^6 + t^5 + t^4 + t^3 + t^2 + t + 1 > xx*ph(c) mod ph(r); -t^28 - t^20 > xx eq -t^20*(1+t^8)*InverseMod(ph(c), ph(r)) mod ph(r); true > A; [ 37, 37, 1, 1, 16 ] > xx; -t^33 - 2*t^32 - 3*t^27 - 2*t^22 - t^21 - t^17 - t^16 - t^12 - 2*t^11 - 3*t^6 - 2*t - 1 > xx*ph(16) mod ph(r); t^31 + t^30 + t^29 + t^28 + t^26 + t^25 + t^24 + t^23 + t^22 + t^20 + t^19 + t^18 + t^17 > xx eq t^17*(((1-t^15) div (1-t)) - t^4 - t^10)*InverseMod(ph(c),ph(r)) mod p\ h(r); true > A; [ 37, 37, 1, 1, 17 ] > xx; 3*t^34 - t^33 + t^32 + 3*t^31 - 2*t^30 + 2*t^29 + 3*t^28 - 3*t^27 + 3*t^26 + 2*t^25 - 2*t^24 + 3*t^23 + t^22 - t^21 + 3*t^20 + 3*t^17 + 3*t^14 - t^13 + t^12 + 3*t^11 - 2*t^10 + 2*t^9 + 3*t^8 - 3*t^7 + 3*t^6 + 2*t^5 - 2*t^4 + 3*t^3 + t^2 - t + 3 > xx*ph(c) mod ph(r); t^32 + t^29 + t^26 + t^24 + t^21 + t^18 > xx eq (t^18*(1+t^8)*(1-t^9) div (1-t^3)) * InverseMod(ph(c),ph(r)) mod ph(r); true > A; [ 37, 37, 1, 1, 18 ] > xx; -t^19 - 1 > xx*ph(c) mod ph(r); t^18 > xx eq t^18*InverseMod(ph(c), ph(r)) mod ph(r); true A; [ 37, 37, 1, 1, 19 ] > xx; t^18 + 1 > InverseMod(t^19*ph(19),ph(r)); t^18 + 1 > A; [ 37, 37, 1, 1, 21 ] > xx; -2*t^34 - 2*t^33 - 2*t^32 - t^31 + t^30 - 2*t^29 - 2*t^28 - 2*t^27 - 2*t^26 + 2*t^25 - 2*t^24 - 2*t^23 - 2*t^22 - 2*t^21 + t^20 - t^19 - 2*t^18 - 2*t^17 - 2*t^16 - t^15 + t^14 - 2*t^13 - 2*t^12 - 2*t^11 - 2*t^10 + 2*t^9 - 2*t^8 - 2*t^7 - 2*t^6 - 2*t^5 + t^4 - t^3 - 2*t^2 - 2*t - 2 > xx*ph(21) mod ph(r); -t^35 - t^30 - t^24 - t^19 > xx eq - (1+t^5)*(1+t^11)*InverseMod(t^18*ph(21),ph(r)) mod ph(r); true > A; [ 37, 37, 1, 1, 23 ] > xx; t^34 + 4*t^33 + 3*t^29 + 2*t^28 + 5*t^24 + 2*t^20 + 3*t^19 + 3*t^15 + 2*t^14 + 5*t^10 + 2*t^6 + 3*t^5 + 4*t + 1 > xx*ph(23) mod ph(r); -t^33 - t^28 - t^23 - t^19 - 1 > t^18*xx*ph(23) mod ph(r); -t^18 - t^14 - t^9 - t^4 - 1 > xx eq -(1+t^4+t^9+t^14+t^18)*InverseMod(t^18*ph(23), ph(r)) mod ph(r); true > A; [ 37, 37, 1, 1, 25 ] > xx; -t^34 - t^33 - t^32 - t^31 - t^30 - t^29 - t^28 - t^27 - t^26 - t^25 - t^24 + t^23 - t^22 - t^21 - t^20 - t^19 - t^18 - t^17 - t^16 - t^15 - t^14 - t^13 - t^12 + t^11 - t^10 - t^9 - t^8 - t^7 - t^6 - t^5 - t^4 - t^3 - t^2 - t - 1 > xx*ph(25) mod ph(r); t^35 + t^23 > xx eq (1+t^12)*InverseMod(t^14*ph(25),ph(r)) mod ph(r); true > A; [ 37, 37, 1, 1, 27 ] > t^5*xx*ph(27) mod ph(r); t^33 + t^30 + t^27 + t^23 + t^10 + t^6 + t^3 + 1 > xx eq (1+t^3+t^6+t^10+t^23+t^27+t^30+t^33)*InverseMod(t^5*ph(27),ph(r)) mod \ ph(r); true > A; [ 37, 37, 1, 1, 29 ] > t^19*xx*ph(29) mod ph(r); -t^26 - t^24 - t^21 - t^18 - t^16 - t^13 - t^10 - t^8 - t^5 - t^2 - 1 > xx eq -(1+t^2+t^5+t^8+t^10+t^13+t^16+t^18+t^21+t^24+t^26)*InverseMod(t^19*ph\ (29),ph(r)) mod ph(r); true > A; [ 37, 37, 1, 1, 31 ] > t^18*xx*ph(31) mod ph(r); t^24 + t^18 + t^12 + t^6 + 1 > xx eq ((1-t^30) div (1-t^6))*InverseMod(t^18*ph(31), ph(r)) mod ph(r); true > A; [ 37, 37, 1, 1, 33 ] > t^18*xx*ph(33) mod ph(r); t^28 + t^24 + t^20 + t^16 + t^12 + t^8 + t^4 + 1 > xx eq -t^18*((1-t^32) div (1-t^4))*InverseMod(ph(c), ph(r)) mod ph(r); true X eq -(t^19*((1-t^32) div (1-t^4))*InverseMod(ph(c), ph(r)) mod ph(r))/t^51/\ Denom([1,1,1,1,r]); > A; [ 37, 37, 1, 1, 34 ] > xx eq -t^19*((1-t^33) div (1-t^3))*InverseMod(ph(c), ph(r)) mod ph(r); true > A; [ 37, 37, 1, 1, 35 ] > t^19*xx*ph(35) mod ph(r); t^32 + t^30 + t^28 + t^26 + t^24 + t^22 + t^20 + t^18 + t^16 + t^14 + t^12 + t^10 + t^8 + t^6 + t^4 + t^2 + 1 > xx eq -t^18*((1-t^34) div (1-t^2))*InverseMod(ph(35), ph(r)) mod ph(r); true > A; [ 37, 37, 1, 1, 36 ] > xx eq -t*((1-t^35) div (1-t))*InverseMod(ph(c), ph(r)) mod ph(r); true c=36 -t*ph(c-1)*InverseMod(ph(c)*ph(r-c),ph(r)) mod ph(r)/t^36/Denom([1,1,1,1,r]); c=35 -t^18*ph(c-1)*InverseMod(ph(c)*ph(r-c),ph(r)) mod ph(r)/t^52/Denom([1,1,1,1,r]); c=34 -t^19*ph(c-1)*InverseMod(ph(c)*ph(r-c),ph(r)) mod ph(r)/t^52/Denom([1,1,1,1,r]); c=33 -t^19*ph(c-1)*InverseMod(ph(c)*ph(r-c),ph(r)) mod ph(r)/t^51/Denom([1,1,1,1,r]); c=32 xx eq t^13*(1+t)*(1+t^3)*ph(4)*InverseMod(ph(c)*ph(r-c), ph(r)) mod ph(r); c=31 -t^19*ph(c-1)*InverseMod(ph(c)*ph(r-c), ph(r)) mod ph(r)/t^49/Denom([1,1,1,1,r]); t^12 * ph(r-c+1) * InverseMod(ph(c)*ph(r-c), ph(r)) mod ph(r)/t^49/Denom([1,1,1,1,r]); c=30 -t^11*(1+t^3+t^4+t^5+t^8)*ph(4)*InverseMod(ph(c)*ph(r-c),ph(r)) mod ph(r); function ph(r); return (1-t^r) div (1-t); end function; r:=17; c:=1; a:=1; b:=1; A:=[r,r,a,b,c]; if GCD(a,b) + GCD(a,c) + GCD(b,c) ne 3 then error "Not coprime"; end if; kP := -&+A; X := 1/Denom(A) - Qorb(A[3],A[[1,2,4,5]],kP) - Qorb(A[4],A[[1,2,3,5]],kP) - Qorb(A[5],A[[1,2,3,4]],kP) - Qorb(r,A[[3,4,5]],kP+r)/(1-t^r); xx := R!(X*t^(r-2+Floor(c/2))*Denom([1,1,1,1,r])); [i : i in [0..r-1] | IsgorensteinSymmetric(t^i*xx mod ph(r))]; c = 2 gives xx is -t^15 - t^13 - t^11 - t^9 - t^6 - t^4 - t^2 - 1 t^8*xx mod ph(r) is -t^14 - t^12 - t^10 - t^8 - t^6 - t^4 - t^2 - 1 = (1-t^16) div (1-t^2) or ph(16) div ph(2) xx eq - t^9*(ph(16) div ph(c)) mod ph(r); // 9 is InverseMod(c,r) xx eq t^8*InverseMod(ph(c),ph(r)) mod ph(r); X eq (t^8*InverseMod(ph(c),ph(r)) mod ph(r))/t^(r-2+Floor(c/2))/Denom([1,1,1,1,r]); xx eq InverseMod(t^9*ph(c),ph(r)); X eq InverseMod(t^9*ph(c),ph(r))/t^(r-2+Floor(c/2))/Denom([1,1,1,1,r]); c = 3 gives -t^14 - t^11 - t^8 - t^6 - t^3 - 1 t^9*xx mod ph(r) is -t^15 - t^12 - t^9 - t^6 - t^3 - 1 = -(1-t^18) div (1-t^3) or ph(18) div ph(3) xx eq - t^8*ph(18) div ph(c) mod ph(r); // who 8? who 18? xx eq -t^8*InverseMod(ph(c),ph(r)) mod ph(r); X eq (-t^8*InverseMod(ph(c),ph(r)) mod ph(r))/t^(r-2+Floor(c/2))/Denom([1,1,1,1,r]); xx eq -InverseMod(t^9*ph(c),ph(r)); X eq -InverseMod(t^9*ph(c),ph(r))/t^(r-2+Floor(c/2))/Denom([1,1,1,1,r]); c = 4 gives -t^13 - t^9 - t^4 - 1 t^8*xx mod ph(r) is -t^15- .. t - 1 = ph(16) xx eq -t^9*ph(16) div ph(4) mod ph(r); xx eq t^8*InverseMod(ph(c),ph(r)) mod ph(r); X eq (t^8*InverseMod(ph(c),ph(r)) mod ph(r))/t^16/Denom([1,1,1,1,r]); X eq (t^9*InverseMod(ph(c),ph(r)) mod ph(r))/t^(r-2+Floor(c/2))/Denom([1,1,1,1,r]); xx eq InverseMod(t^8*ph(c),ph(r)); X eq InverseMod(t^8*ph(c),ph(r))/t^(r-2+Floor(c/2))/Denom([1,1,1,1,r]); c = 5; need to mult by t^17 (not t^16 as before); gives t^14 - t^13 + t^12 + t^9 - t^8 + t^7 - t^6 + t^5 + t^2 - t + 1 xx eq -t^8*(1+t^2)*InverseMod(ph(c),ph(r)) mod ph(r); // who 8 X eq (-t^8*(1+t^2)*InverseMod(ph(c),ph(r)) mod ph(r))/t^(r-2+Floor(c/2))/Denom([1,1,1,1,r]); xx eq -(1+t^2)*InverseMod(t^9*ph(c),ph(r)) mod ph(r); // who 8 X eq (-(1+t^2)*InverseMod(t^9*ph(c),ph(r)) mod ph(r))/t^(r-2+Floor(c/2))/Denom([1,1,1,1,r]); c = 6; *t^16 gives -(1+t^11) xx eq -t^13*ph(12) div ph(6) mod ph(r); X eq (t^8*ph(5)*InverseMod(ph(c),ph(r)) mod ph(r))/t^(r-2+Floor(c/2))/Denom([1,1,1,1,r]); xx eq ph(5)*InverseMod(t^9*ph(c),ph(r)) mod ph(r); X eq (ph(5)*InverseMod(t^9*ph(c),ph(r)) mod ph(r))/t^(r-2+Floor(c/2))/Denom([1,1,1,1,r]); c = 7; *t^18 gives t^14 + t^13 - t^12 + t^11 + t^10 + t^7 + t^4 + t^3 - t^2 + t + 1 xx eq -(1+t^4)*InverseMod(t^9*ph(c),ph(r)) mod ph(r); X eq (-(1+t^4)*InverseMod(t^9*ph(c),ph(r)) mod ph(r))/t^(r-2+Floor(c/2))/Denom([1,1,1,1,r]); c = 8; *t^16 gives -1-t^9 xx eq InverseMod(t^6*ph(c),ph(r)) mod ph(r); X eq InverseMod(t^6*ph(c),ph(r))/t^19/Denom([1,1,1,1,r]); c = 9; *t^16 gives -1-t^8 xx eq -t^8*InverseMod(ph(c),ph(r)) mod ph(r); X eq (-t^8*InverseMod(ph(c),ph(r)) mod ph(r))/t^16/Denom([1,1,1,1,r]); X eq (-t^11*InverseMod(ph(c),ph(r)) mod ph(r))/t^(r-2+Floor(c/2))/Denom([1,1,1,1,r]); c = 10; *t^20 gives -t^15 - 2*t^14 - 3*t^11 - 2*t^8 - 2*t^7 - 3*t^4 - 2*t - 1 xx eq (t^10+t^14 + ph(8))*InverseMod(ph(c), ph(r)) mod ph(r); X eq ((t^10+t^14 + ph(8))*InverseMod(ph(c), ph(r)) mod ph(r))/t^(r-2+Floor(c/2))/Denom([1,1,1,1,r]); c = 11; *t^20 gives t^14 + t^13 + t^12 + t^11 - t^10 + t^9 + t^8 + t^7 + t^6 + t^5 - t^4 + t^3 + t^2 + t + 1 xx eq t^9*(1+t^6)*InverseMod(ph(c),ph(r)) mod ph(r); X eq (t^9*(1+t^6)*InverseMod(ph(c),ph(r)) mod ph(r))/t^(r-2+Floor(c/2))/Denom([1,1,1,1,r]); c = 12; *t^21 gives -4*t^15 - t^14 - 2*t^13 - 3*t^12 - 5*t^10 - 3*t^8 - 3*t^7 - 5*t^5 - 3*t^3 - 2*t^2 - t - 4 xx eq -((t^8*ph(12) + t^11*(1+t^5)) div ph(2))*InverseMod(ph(c),ph(r)) mod ph(r); xx eq -((t^8*ph(c) + t^11*(1+t^(r-c))) div ph(2))*InverseMod(ph(c),ph(r)) mod ph(r); X eq (-((t^8*ph(c) + t^11*(1+t^(r-c))) div ph(2))*InverseMod(ph(c),ph(r)) mod ph(r))/t^(r-2+Floor(c/2))/Denom([1,1,1,1,r]); c = 13; *t^21 gives -t^14 - 2*t^13 - 3*t^9 - 3*t^5 - 2*t - 1 xx eq - t^9*(ph(12) div ph(4))*InverseMod(ph(c),ph(r)) mod ph(r); X eq (-t^9*(ph(12) div ph(4))*InverseMod(ph(c),ph(r)) mod ph(r))/t^(r-2+Floor(c/2))/Denom([1,1,1,1,r]); c = 14; *t^22 xx eq t^8*(ph(15) div ph(3))*InverseMod(ph(c), ph(r)) mod ph(r); X eq (t^8*(ph(15) div ph(3))*InverseMod(ph(c), ph(r)) mod ph(r))/t^(r-2+Floor(c/2))/Denom([1,1,1,1,r]); c = 15; *t^22 xx eq -t^8*(ph(14) div ph(2))*InverseMod(ph(c), ph(r)) mod ph(r); X eq (-t^8*(ph(14) div ph(2))*InverseMod(ph(c), ph(r)) mod ph(r))/t^(r-2+Floor(c/2))/Denom([1,1,1,1,r]); c = 16; *t^16 gives -(1+t) xx eq - t*ph(15)*InverseMod(ph(c),ph(r)) mod ph(r); *t^23 gives -t^7*(1+t) xx eq (t^6+t^7)*InverseMod(ph(c),ph(r)) mod ph(r); X eq ((t^6+t^7)*InverseMod(ph(c),ph(r)) mod ph(r))/t^(r-2+Floor(c/2))/Denom([1,1,1,1,r]); ====================== r = 23 c = 2 (1-t^22) div (1-t^2) eq t^11*xx mod ph(r); xx eq t^12*(ph(22) div ph(2)) mod ph(r); t^((r+1) div 2)*(ph(r-1) div ph(c)) mod ph(r); // if c = 2 -t^((r-1) div 2)*InverseMod(ph(c),ph(r)) mod ph(r); // if c = 2 c = 3 -(1-t^24) div (1-t^3) eq t^12*xx mod ph(r); xx eq -t^11*(ph(24) div ph(3)) mod ph(r); -t^((r-1) div 2)*(ph(r+1) div ph(c)) mod ph(r); // if c = 3 -t^((r-1) div 2)*InverseMod(ph(c),ph(r)) mod ph(r); // if c = 3 c = 4 -(1-t^24) div (1-t^4) eq t^11*xx mod ph(r); -t^((r+1) div 2)*(ph(r+1) div ph(4)) mod ph(r); // if c = 4 -t^((r+1) div 2)*InverseMod(ph(c),ph(r)) mod ph(r); // if c = 4 c=5 xx eq t^13*(1+t^21)*InverseMod(ph(c),ph(r)) mod ph(r); xx eq t^11*(1+t^2)*InverseMod(ph(c),ph(r)) mod ph(r); c=6 xx eq -t^13*InverseMod(ph(c),ph(r)) mod ph(r); c=7 xx eq -t^11*ph(6) div ph(2)*InverseMod(ph(c),ph(r)) mod ph(r); xx eq -t^11*ph(6)*InverseMod(ph(2)*ph(c),ph(r)) mod ph(r); c=8 xx eq t^11*ph(7)*InverseMod(ph(c),ph(r)) mod ph(r); c=9 xx eq t^12*(1+t^4)*InverseMod(ph(c),ph(r)) mod ph(r); c=10; this is an awkward one xx eq t^11*(ph(9) - t^2*(1+t^4))*InverseMod(ph(c),ph(r)) mod ph(r); The awkward point being that ph(9) - t^2*(1+t^4) = t^8 + t^7 + t^5 + t^4 + t^3 + t + 1 does not have any other reasonable form. (As a number, it has Norm = 47^2 in CyclotomicField(ep).) c=11; this one (r-1)/2 has many small solutions xx = t^4*(1+t^12) xx = t^16*(1+t^11) mod ph(r) xx = t^15*InverseMod(ph(c),ph(r)) mod ph(r) c=12; similar xx = -t^5*(1+t^11) xx = -t^16*(1+t^12) mod ph(r) xx = -t^16*InverseMod(ph(c),ph(r)) mod ph(r) c = 13 xx eq t^11*(1+t^3)*(1+t^7)*InverseMod(ph(c),ph(r)) mod ph(r); c = 14; very similar to the case c = 10 xx eq t^11*(ph(13)-t^4*(1+t^4))*InverseMod(ph(c),ph(r)) mod ph(r); c = 15 xx eq t^13*(1+t^8)*InverseMod(ph(c),ph(r)) mod ph(r); c = 16; another awkward one, related to c = 7? xx eq t^11*(ph(16) div ph(2) - t^4*((1+t^7) div ph(2))) * InverseMod(ph(c),ph(r)) mod ph(r); xx eq t^11*(ph(16)-t^4*(1+t^7))*InverseMod(ph(2)*ph(c),ph(r)) mod ph(r); c = 17; xx eq t^12*(1-t^18) div (1-t^6) * InverseMod(ph(c),ph(r)) mod ph(r); c = 18; a very awkward one xx eq t^11*(ph(17)-t^2*((1-t^14) div (1-t^2))+t^6*((1+t^5) div (1+t))) * InverseMod(ph(c),ph(r)) mod ph(r); ?? maybe a better expression for it ?? c = 19; xx eq t^11*ph(20)*InverseMod(ph(r-c)*ph(c),ph(r)) mod ph(r); c = 20 xx eq t^11*ph(21)*InverseMod(ph(r-c)*ph(c),ph(r)) mod ph(r); c = 21 xx eq -t^11*ph(20)*InverseMod(ph(r-c)*ph(c),ph(r)) mod ph(r); c = 22 xx = -t^10*(1+t); xx = t^9*(1+t)*InverseMod(ph(c),ph(r)) mod ph(r); xx eq t^12*ph(21) mod ph(r); (r,r,1,2,3) xx eq -t^11*(ph(24) div ph(6))*(1-t+t^2) mod ph(r) [r,r,1,2,5] xx eq t^14*((ph(22) div ph(2))-t*ph(19))*InverseMod(ph(c),ph(r)) mod ph(r); [r,r,1,2,7] t^12*xx*ph(2)*ph(c) mod ph(r) + 2*ph(7) + t*(ph(6) div ph(2)); xx eq -t^11*(2*ph(7) + t*(ph(6) div ph(2)))*InverseMod(ph(2)*ph(c),ph(r)) mod ph(r); ==================================== Calculate X as rest to be explained. Its numerator xx := R!(X*t^(r-2+Floor(c/2))*Denom([1,1,1,1,r])); note that we do something different acc to c even or odd. > t^((10-Floor(c/2)) mod r)*xx*ph(c) mod ph(r); Shows that there are two different cases acc. to c mod 4 either that quantity is Gor symm of deg r or it is a sum of (plus-or-minus 1) plus Gor symm of deg r. r:=17; c:=1; a:=1; b:=1; A:=[r,r,a,b,c]; if GCD(a,b) + GCD(a,c) + GCD(b,c) ne 3 then error "Not coprime"; end if; kP := -&+A; X := 1/Denom(A) - Qorb(A[3],A[[1,2,4,5]],kP) - Qorb(A[4],A[[1,2,3,5]],kP) - Qorb(A[5],A[[1,2,3,4]],kP) - Qorb(r,A[[3,4,5]],kP+r)/(1-t^r); xx := R!(X*t^(r-2+Floor(c/2))*Denom([1,1,1,1,r])); Want to mechanise the process of tabulating results. function XX(r,a,b,c) if GCD(a,b) + GCD(a,c) + GCD(b,c) + GCD(a,r) + GCD(b,r) + GCD(c,r) ne 6 then error "Not coprime"; end if; A := [r,r,a,b,c]; kP := -&+A; X := 1/Denom(A) - Qorb(A[3],A[[1,2,4,5]],kP) - Qorb(A[4],A[[1,2,3,5]],kP) - Qorb(A[5],A[[1,2,3,4]],kP) - Qorb(r,A[[3,4,5]],kP+r)/(1-t^r); xx := R!(X*t^(r-2+Floor(c/2))*Denom([1,1,1,1,r])); return xx,X; end function; c = 33 > xx eq ph(15)*ph(17)-t^15; c = 32 > xx eq -(t*(ph(c) div ph(2)) + 2*t^16 + 14*ph(r)^2) div ph(2); c = 2 xx eq -(ph(8) div ph(2))*InverseMod(ph(ga),ph(r)) mod ph(r); > xx eq -ph(8)*InverseMod(ph(ga)*ph(c),ph(r)) mod ph(r); c = 3 xx eq -(ph(6) div ph(3))*InverseMod(t^9*ph(ga),ph(r)) mod ph(r); xx eq -t^8*InverseMod(ph(c),ph(r)) mod ph(r); c = 4 xx eq -InverseMod(t^12*ph(ga), ph(r)); c = 5 xx eq (1+t^2)*(1+t^5)*InverseMod(t^2*ph(ga),ph(r)) mod ph(r); xx eq (1+t^2)*(1+t^12)*InverseMod(t^14*ph(ga),ph(r)) mod ph(r); > [XX(17,1,1,i) : i in [1..16]]; [ 0, -t^15 - t^13 - t^11 - t^9 - t^6 - t^4 - t^2 - 1, -t^14 - t^11 - t^8 - t^6 - t^3 - 1, -t^14 - t^10 - t^5 - t, t^14 - t^13 + t^12 + t^9 - t^8 + t^7 - t^6 + t^5 + t^2 - t + 1, -t^13 - t^2, t^14 + t^13 - t^12 + t^11 + t^10 + t^7 + t^4 + t^3 - t^2 + t + 1, -t^12 - t^3, -t^11 - t^3, -t^15 - 2*t^14 - 3*t^11 - 2*t^8 - 2*t^7 - 3*t^4 - 2*t - 1, t^14 + t^13 + t^12 + t^11 - t^10 + t^9 + t^8 + t^7 + t^6 + t^5 - t^4 + t^3 + t^2 + t + 1, -4*t^15 - t^14 - 2*t^13 - 3*t^12 - 5*t^10 - 3*t^8 - 3*t^7 - 5*t^5 - 3*t^3 - 2*t^2 - t - 4, -t^14 - 2*t^13 - 3*t^9 - 3*t^5 - 2*t - 1, -3*t^15 - 2*t^14 - 4*t^12 - t^11 - 5*t^9 - 5*t^6 - t^4 - 4*t^3 - 2*t - 3, -t^14 + t^13 - 2*t^12 + 2*t^11 - 3*t^10 + 3*t^9 - 4*t^8 + 3*t^7 - 4*t^6 + 3*t^5 - 3*t^4 + 2*t^3 - 2*t^2 + t - 1, -t^8 - t^7 ] > [XX(17,1,1,i) : i in [18..33]]; [ 0, -t^14 + t^13 - 2*t^12 + 2*t^11 - 3*t^10 + 3*t^9 - 4*t^8 + 4*t^7 - 4*t^6 + 3*t^5 - 3*t^4 + 2*t^3 - 2*t^2 + t - 1, -4*t^15 - 3*t^14 - 5*t^12 - 2*t^11 - 6*t^9 - t^8 - t^7 - 6*t^6 - 2*t^4 - 5*t^3 - 3*t - 4, -2*t^14 - 3*t^13 - t^10 - 4*t^9 - 4*t^5 - t^4 - 3*t - 2, -7*t^15 - 2*t^14 - 3*t^13 - 6*t^12 - 8*t^10 - t^9 - 4*t^8 - 4*t^7 - t^6 - 8*t^5 - 6*t^3 - 3*t^2 - 2*t - 7, 2*t^14 + 2*t^13 + 2*t^12 + 2*t^11 - t^10 + t^9 + 2*t^8 + 2*t^7 + 2*t^6 + t^5 - t^4 + 2*t^3 + 2*t^2 + 2*t + 2, -2*t^15 - 5*t^14 - 6*t^11 - t^10 - 3*t^8 - 3*t^7 - t^5 - 6*t^4 - 5*t - 2, -t^12 - 2*t^11 - 2*t^3 - t^2, -2*t^12 - t^11 - t^4 - 2*t^3, 4*t^14 + 3*t^13 - 3*t^12 + 4*t^11 + 4*t^10 - 2*t^9 + 2*t^8 + 4*t^7 + 2*t^6 - 2*t^5 + 4*t^4 + 4*t^3 - 3*t^2 + 3*t + 4, -t^14 - 4*t^13 - 3*t^8 - 3*t^7 - 4*t^2 - t, 5*t^14 - 5*t^13 + 6*t^12 - 2*t^11 + 2*t^10 + 3*t^9 - 3*t^8 + 6*t^7 - 3*t^6 + 3*t^5 + 2*t^4 - 2*t^3 + 6*t^2 - 5*t + 5, -6*t^14 - t^13 - 4*t^10 - 3*t^9 - 3*t^6 - 4*t^5 - t^2 - 6*t, -9*t^14 + t^13 - 2*t^12 - 7*t^11 + t^10 - 4*t^9 - 5*t^8 + t^7 - 5*t^6 - 4*t^5 + t^4 - 7*t^3 - 2*t^2 + t - 9, -14*t^15 - t^14 - 12*t^13 - 3*t^12 - 10*t^11 - 5*t^10 - 8*t^9 - 7*t^8 - 7*t^7 - 8*t^6 - 5*t^5 - 10*t^4 - 3*t^3 - 12*t^2 - t - 14, t^14 + t^13 + t^12 + t^11 + t^10 + t^9 + t^8 + t^7 + t^6 + t^5 + t^4 + t^3 + t^2 + t + 1 ] These quantities are often closely related to Porb(1/17(i)): tabulate them against one another using > [[XX(17,1,1,i),Qorb(17,[i],-17-i)*Denom([1,17])*t^(7+Floor(i/2))] : i in [1..33] | GCD(i,17) eq 1]; i=1: 0, t^7 i=2: -t^15 - t^13 - t^11 - t^9 - t^6 - t^4 - t^2 - 1, -t^15 - t^13 - t^11 - t^9 - t^6 - t^4 - t^2 - 1 i=3: -t^14 - t^11 - t^8 - t^6 - t^3 - 1, t^14 + t^11 + t^8 + t^6 + t^3 + 1 i=4: -t^14 - t^10 - t^5 - t, -t^14 - t^10 - t^5 - t i=5: t^14 - t^13 + t^12 + t^9 - t^8 + t^7 - t^6 + t^5 + t^2 - t + 1, t^14 + t^12 + t^9 + t^7 + t^5 + t^2 + 1 i=6: -t^13 - t^2, -t^15 - t^14 - t^13 - t^12 - t^11 - t^9 - t^8 - t^7 - t^6 - t^4 - t^3 - t^2 - t - 1 i=7: t^14 + t^13 - t^12 + t^11 + t^10 + t^7 + t^4 + t^3 - t^2 + t + 1, t^14 + t^10 + t^7 + t^4 + 1 i=8: -t^12 - t^3, -t^12 - t^3 i=9: -t^11 - t^3, t^11 + t^3 i=10: -t^15 - 2*t^14 - 3*t^11 - 2*t^8 - 2*t^7 - 3*t^4 - 2*t - 1, t^15 + t^14 + t^12 + t^11 + t^10 + t^8 + t^7 + t^5 + t^4 + t^3 + t + 1 i=11: t^14 + t^13 + t^12 + t^11 - t^10 + t^9 + t^8 + t^7 + t^6 + t^5 - t^4 + t^3 + t^2 + t + 1, -t^13 - t^7 - t i=12: -4*t^15 - t^14 - 2*t^13 - 3*t^12 - 5*t^10 - 3*t^8 - 3*t^7 - 5*t^5 - 3*t^3 - 2*t^2 - t - 4, t^15 + t^13 + t^12 + t^10 + t^8 + t^7 + t^5 + t^3 + t^2 + 1 i=13: -t^14 - 2*t^13 - 3*t^9 - 3*t^5 - 2*t - 1, t^13 + t^9 + t^5 + t i=14: -3*t^15 - 2*t^14 - 4*t^12 - t^11 - 5*t^9 - 5*t^6 - t^4 - 4*t^3 - 2*t - 3, -t^15 - t^12 - t^9 - t^6 - t^3 - 1 i=15: -t^14 + t^13 - 2*t^12 + 2*t^11 - 3*t^10 + 3*t^9 - 4*t^8 + 3*t^7 - 4*t^6 + 3*t^5 - 3*t^4 + 2*t^3 - 2*t^2 + t - 1, t^14 + t^12 + t^10 + t^8 + t^6 + t^4 + t^2 + 1 i=16: -t^8 - t^7, t^15 + t^14 + t^13 + t^12 + t^11 + t^10 + t^9 + t^8 + t^7 + t^6 + t^5 + t^4 + t^3 + t^2 + t + 1 i=18: 0, -t^15 - t^14 - t^13 - t^12 - t^11 - t^10 - t^9 - t^8 - t^7 - t^6 - t^5 - t^4 - t^3 - t^2 - t - 1 i=19: -t^14 + t^13 - 2*t^12 + 2*t^11 - 3*t^10 + 3*t^9 - 4*t^8 + 4*t^7 - 4*t^6 + 3*t^5 - 3*t^4 + 2*t^3 - 2*t^2 + t - 1, -t^14 - t^12 - t^10 - t^8 - t^6 - t^4 - t^2 - 1 i=20: -4*t^15 - 3*t^14 - 5*t^12 - 2*t^11 - 6*t^9 - t^8 - t^7 - 6*t^6 - 2*t^4 - 5*t^3 - 3*t - 4, t^15 + t^12 + t^9 + t^6 + t^3 + 1 i=21: -2*t^14 - 3*t^13 - t^10 - 4*t^9 - 4*t^5 - t^4 - 3*t - 2, -t^13 - t^9 - t^5 - t i=22: -7*t^15 - 2*t^14 - 3*t^13 - 6*t^12 - 8*t^10 - t^9 - 4*t^8 - 4*t^7 - t^6 - 8*t^5 - 6*t^3 - 3*t^2 - 2*t - 7, -t^15 - t^13 - t^12 - t^10 - t^8 - t^7 - t^5 - t^3 - t^2 - 1 i=23: 2*t^14 + 2*t^13 + 2*t^12 + 2*t^11 - t^10 + t^9 + 2*t^8 + 2*t^7 + 2*t^6 + t^5 - t^4 + 2*t^3 + 2*t^2 + 2*t + 2, t^13 + t^7 + t i=24: -2*t^15 - 5*t^14 - 6*t^11 - t^10 - 3*t^8 - 3*t^7 - t^5 - 6*t^4 - 5*t - 2, -t^15 - t^14 - t^12 - t^11 - t^10 - t^8 - t^7 - t^5 - t^4 - t^3 - t - 1 i=25: -t^12 - 2*t^11 - 2*t^3 - t^2, -t^11 - t^3 i=26: -2*t^12 - t^11 - t^4 - 2*t^3, t^12 + t^3 i=27: 4*t^14 + 3*t^13 - 3*t^12 + 4*t^11 + 4*t^10 - 2*t^9 + 2*t^8 + 4*t^7 + 2*t^6 - 2*t^5 + 4*t^4 + 4*t^3 - 3*t^2 + 3*t + 4, -t^14 - t^10 - t^7 - t^4 - 1 i=28: -t^14 - 4*t^13 - 3*t^8 - 3*t^7 - 4*t^2 - t, t^15 + t^14 + t^13 + t^12 + t^11 + t^9 + t^8 + t^7 + t^6 + t^4 + t^3 + t^2 + t + 1 i=29: 5*t^14 - 5*t^13 + 6*t^12 - 2*t^11 + 2*t^10 + 3*t^9 - 3*t^8 + 6*t^7 - 3*t^6 + 3*t^5 + 2*t^4 - 2*t^3 + 6*t^2 - 5*t + 5, -t^14 - t^12 - t^9 - t^7 - t^5 - t^2 - 1 i=30: -6*t^14 - t^13 - 4*t^10 - 3*t^9 - 3*t^6 - 4*t^5 - t^2 - 6*t, t^14 + t^10 + t^5 + t i=31: -9*t^14 + t^13 - 2*t^12 - 7*t^11 + t^10 - 4*t^9 - 5*t^8 + t^7 - 5*t^6 - 4*t^5 + t^4 - 7*t^3 - 2*t^2 + t - 9, -t^14 - t^11 - t^8 - t^6 - t^3 - 1 i=32: -14*t^15 - t^14 - 12*t^13 - 3*t^12 - 10*t^11 - 5*t^10 - 8*t^9 - 7*t^8 - 7*t^7 - 8*t^6 - 5*t^5 - 10*t^4 - 3*t^3 - 12*t^2 - t - 14, t^15 + t^13 + t^11 + t^9 + t^6 + t^4 + t^2 + 1 i=33: t^14 + t^13 + t^12 + t^11 + t^10 + t^9 + t^8 + t^7 + t^6 + t^5 + t^4 + t^3 + t^2 + t + 1, -t^7 For c in a fixed class mod 2*r = 17, the terms grow as an arithmetic prog. [XX(17,1,1,1+34*i) : i in [0..5]]; [ 0, t^14 + t^13 + t^12 + t^11 + t^10 + t^9 + t^8 + t^7 + t^6 + t^5 + t^4 + t^3 + t^2 + t + 1, 2*t^14 + 2*t^13 + 2*t^12 + 2*t^11 + 2*t^10 + 2*t^9 + 2*t^8 + 2*t^7 + 2*t^6 + 2*t^5 + 2*t^4 + 2*t^3 + 2*t^2 + 2*t + 2, 3*t^14 + 3*t^13 + 3*t^12 + 3*t^11 + 3*t^10 + 3*t^9 + 3*t^8 + 3*t^7 + 3*t^6 + 3*t^5 + 3*t^4 + 3*t^3 + 3*t^2 + 3*t + 3, 4*t^14 + 4*t^13 + 4*t^12 + 4*t^11 + 4*t^10 + 4*t^9 + 4*t^8 + 4*t^7 + 4*t^6 + 4*t^5 + 4*t^4 + 4*t^3 + 4*t^2 + 4*t + 4, 5*t^14 + 5*t^13 + 5*t^12 + 5*t^11 + 5*t^10 + 5*t^9 + 5*t^8 + 5*t^7 + 5*t^6 + 5*t^5 + 5*t^4 + 5*t^3 + 5*t^2 + 5*t + 5 ] > [XX(17,1,1,18+34*i) : i in [0..5]]; [ 0, -t^8 - t^7, -2*t^8 - 2*t^7, -3*t^8 - 3*t^7, -4*t^8 - 4*t^7, -5*t^8 - 5*t^7 ] yy := XX(17,1,1,2+34) - Qorb(17,[2],-19)*Denom([1,17])*t^8; yy; -15*t^15 - t^14 - 13*t^13 - 3*t^12 - 11*t^11 - 5*t^10 - 9*t^9 - 7*t^8 - 7*t^7 - 9*t^6 - 5*t^5 - 11*t^4 - 3*t^3 - 13*t^2 - t - 15 [XX(17,1,1,2+34*i) eq Qorb(17,[2],-19)*Denom([1,17])*t^8 + i*yy : i in [1..5]]; [ true, true, true, true, true ] [XX(17,1,1,19+34*i) -Qorb(17,[2],-36)*Denom([1,17])*t^16 : i in [1..5]];