// --------------------------------------------------------------------- // CHECK_classnumbers.magma // // David Niedbala Giraudin, ORCID 0009-0009-1526-1178. // Technical assistance: Claude (Anthropic). // // Third party check of the class number identities used in the counting // step of "Sums of three composite triangular numbers". // // Written for the Sydney online Magma calculator: one submission, well // inside the 60 second limit and the 50000 byte input limit. // Output is produced line by line, so a truncated run still shows the // checks that completed. // --------------------------------------------------------------------- r3 := function(N) c := 0; L := Isqrt(N); for x in [-L..L] do R := N - x*x; if R lt 0 then continue; end if; M := Isqrt(R); for y in [-M..M] do z2 := R - y*y; if z2 lt 0 then continue; end if; z := Isqrt(z2); if z*z eq z2 then if z eq 0 then c +:= 1; else c +:= 2; end if; end if; end for; end for; return c; end function; // (1) N = 3 mod 8 squarefree : r_3(N) = 24 h(-N) bad1 := []; for N in [11..1200 by 8] do if not IsSquarefree(N) then continue; end if; h := ClassNumber(QuadraticField(-N)); if r3(N) ne 24*h then Append(~bad1, N); end if; end for; printf "r_3(N) = 24 h(-N), N = 3 mod 8 squarefree, 11 <= N < 1200 : %o\n", bad1; // (2) conductor 3 : r_3(9 N0) = 24 h(-N0) (4 - (D|3)) bad2 := []; for N0 in [11..300 by 8] do if not IsSquarefree(N0) then continue; end if; h := ClassNumber(QuadraticField(-N0)); k := KroneckerSymbol(-N0, 3); if r3(9*N0) ne 24*h*(4-k) then Append(~bad2, N0); end if; end for; printf "r_3(9 N0) = 24 h(-N0) (4 - (D|3)), 11 <= N0 < 300 : %o\n", bad2; // (3) conductor 5 : r_3(25 N0) = 24 h(-N0) (6 - (D|5)) bad3 := []; for N0 in [11..150 by 8] do if not IsSquarefree(N0) then continue; end if; h := ClassNumber(QuadraticField(-N0)); k := KroneckerSymbol(-N0, 5); if r3(25*N0) ne 24*h*(6-k) then Append(~bad3, N0); end if; end for; printf "r_3(25 N0) = 24 h(-N0) (6 - (D|5)), 11 <= N0 < 150 : %o\n", bad3; print "empty lists mean no discrepancy";