The Lagrange path
Lagrange proved Wilson's theorem, and extended it as follows:
Lagrange's theorem (1777).
Here I show the behaviour of
(mod
) for all odd primes up to
| > | L := []: for p from 5 by 4 to 200 do if isprime(p) then
R2||p := PRFAC(1, (p-1)/2, p, 1): ### COMPUTING THE HALF-FACTORIAL RESIDUE L := [op(L), p]: fi od: print(``); print(array([ ['p', ``, ``, '({p-1}/2)!', ``, ``, '({p-1}/2)!^2'], seq([p, ``, ``, R2||p, ``, ``, mods(R2||p^2, p)], ### NOTICE THE SQUARE OF THE HALF-FACTORIAL RESIDUE p = L)])): print(``); lprint(`The final two columns show LEAST ABSOLUTE residues mod p.`); |
![]() |
|
| `The final two columns show LEAST ABSOLUTE residues mod p.` |
| > |
| > | L := []: for p from 5 by 4 to 250 do if isprime(p) then
R4||p := PRFAC(1, (p-1)/4, p, 1): L := [op(L), p]: fi od: print(``); print(array([ ['p', ``, ``, '({p-1}/4)!', ``, ``, '({p-1}/4)!^2', ``, ``, '({p-1}/4)!^4'], seq([p, ``, ``, R4||p, ``, ``, mods(R4||p^2, p), ``, ``, mods(R4||p^4, p)], p = L)])): print(``); lprint(`The final three columns show LEAST ABSOLUTE residues mod p.`); |
![]() |
|
| `The final three columns show LEAST ABSOLUTE residues mod p.` |
| > |
| > | L := []: for p from 5 by 4 to 250 do if isprime(p) then
R4||p := PRFAC(1, (p-1)/4, p, 1): L := [op(L), p]: fi od: print(``); print(array([['p', ``, ``, '({p-1}/4)!^8'], seq([p, ``, ``, mods(R4||p^8, p)], ### NOTICE THE 8-TH POWER p = L)])): print(``); lprint(`The final column show LEAST ABSOLUTE residues mod p,`); print(``); lprint(`and take note of those TWO -1 residues at p = 17 and 241.,`); |
![]() |
|
| `The final column show LEAST ABSOLUTE residues mod p,` | |
| `and take note of those TWO -1 residues at p = 17 and 241.,` |
| > |
| > |