Chap. Ill] FeRMAt's AND WiLSON's THEOREMS. * 65 
C. F. Gauss^^ proved that, if n is a prime, 2, 3, . . . , n— 2 can be associated 
in pairs such that the product of the two of a pair is of the form xn+1. 
This step completes Schaffgotsch's^^ proof of Wilson's theorem. 
Gauss^^ proved Fermat's theorem by the method now known to be 
that used by Leibniz^ and mentioned the fact that the reputed proof by 
Leibniz had not then been published. 
Gauss^*^ proved that if a belongs to the exponent t modulo p, a prime, 
then a-a^-a^ . . .a^^i — lY'^^ (mod p). In fact, a primitive root p of p 
may be chosen so that a=p^^~^^'\ Thus the above product is congruent 
to p*, where 
Thus p*=(p~2~}''^^ = ( — 1)'"*"^ (mod p). When a is a primitive root, a, 
a^,. . ., aF~^ are congruent to 1, 2, . . . , p — 1 in some order. Hence (p — 1) != 
( — 1)^. This method of proving Wilson's theorem is essentially that of 
Euler.22 
Gauss^^ stated the generalization of Wilson's theorem: The product of 
the positive integers < A and prime to A is congruent modulo ^ to — 1 if 
A = 4, p"* or 2p^, where p is an odd prime, but to + 1 if ^ is not of one of 
these three forms. He remarked that a proof could be made by use of 
associated numbers^^ with the difference that a;^=l (mod A) may now 
have roots other than ± 1 ; also by use of indices and primitive roots^° of a 
composite modulus. 
S. F. Lacroix^^ reproduced Euler's^^ third proof of Fermat's theorem 
without giving a reference. 
James Ivory^^ obtained Fermat's theorem by a proof later rediscovered 
by Dirichlet.^" Let N be any integer not divisible by the prime p. When 
the multiples N, 2N, SN, . . ., {p — l)N are divided by p, there result p dis- 
tinct positive remainders <p, so that these remainders are 1, 2, . . ., p — 1 
in some order .^^ By multiplication, N^~^Q = Q-\-mp, where Q = (p — 1)!. 
Hence p divides iV^~^ — 1 since it does not divide Q. 
Gauss^^ used the last method in his proof of the lemma (employed in his 
third proof of the quadratic reciprocity law): If k is not divisible by the 
odd prime p, and if exactly /x of the least positive residues of k, 2k,. . ., 
l{p-l)k modulo p exceed p/2, then k^p-'^^^^= ( - 1)" (mod p) . [Cf . Grunert.^^] 
''^Disquisitiones Arith., 1801, arts. 24, 77; Werke, 1, 1863, 19, 61. 
2*Disq. Arith., art. 51, footnote to art. 50. 
soDisq. Arith., art. 75. 
^iDisq. Arith., art. 78. 
32Compl4ment des 416mens d'alglbre, Paris, ed. 3, 1804, 298-303; ed. 4, 1817, 313-7, 
"New Series of the Math. Repository (ed. Th. Leybourn), vol. 1, pt. 2, 1806, 6-8. 
"A fact known to Euler, Novi Comm. Acad. Petrop., 8, 1760-1, 75; Comm. Arith., 1, 275; 
and to Gauss, Disq. Arith., art. 23. Cf. G. Tarry, Nouv. Ann. Math., 18, 1899, 
149, 292. 
^''Comm. soc. reg. so. Gottingensis, 16, 1808; Werke, 2, 1-8. Gauss' Hohere Arith., German 
transl. by H. Maser, Berhn, 1889, p. 458. 
