Chap. Ill] FerMAt's AND WiLSON's THEOREMS. 61 
divisible by y, at most p — 1 of the positive residues < p, obtained by dividing 
1, a, a^, . . . by p, are distinct. Let, therefore; a" and a", where ix^v, have the 
same residue. Then a""" — 1 is divisible by p. Let X be the least positive 
integer for which a^ — \ is divisible by p. Then \,a,a^,..., a^~^ have dis- 
tinct residues when divided by p, so that X^p — L IfX = p — 1, Fermat's 
theorem is proved. If X<p — 1, there exists a positive integer k ik<p) 
which is not the residue of a power of a. Then k, ak, a^k, . . ., a^~^k have 
distinct residues, no one the residue of a power of a. Since the two sets 
give 2X distinct residues, we have 2X^ p — 1. If X< (p — 1)/2, we start with 
a new residue s and see that s, as, a^s, . . ., a^~^s have distinct residues, no one 
the residue of a power of a or of a^k. Hence X^ (p — 1)/3. Proceeding in 
this manner, we see that X divides p — L Thus d^~^ — 1 is divisible by a'' — 1 
and hence by p. 
L. Euler^^ soon gave his fundamental generalization of Fermat's theorem 
from the case of a prime to any integer N: 
Euler's theorem: If n=(f){N) is the number of positive integers not 
exceeding N and relatively prime to N, then x" — 1 is divisible by N for 
every integer x relatively prime to N. 
Let V be the least positive integer for which x" has the residue 1 when 
divided by N. Then the residues of 1, a:, a:^, ... , x"'^ are distinct and prime 
to N. Thus v^n. If v<n, there is an additional positive integer a less 
than A'' and prime to N. Then, when a, ax, ax^, . . ., ax"'^ are divided by N, 
the residues are distinct from each other and from those of the powers of x. 
Thus, 2v^n. Similarly, if 2v<n, then Zv^n. It follows in this manner 
that V divides n. 
J. H. Lambert^^ gave a proof of Fermat's theorem differing shghtly from 
the first proof by Euler.^" If h is not divisible by the prime p, 6^"^ — 1 is 
divisible by p. For, set 6 = c+L Then 
6^-^-1 =-l+c''-i + (p-l)c^-2+...+l 
= -l+c^-'-c^-2 +0^"^- . . . +1+Ap, 
where A is an integer. The intermediate terms equal 
Hence 
c+1 c+1 
-fA-/, /=' 
P p ' P(c+1) 
The theorem will thus follow by induction if / is shown to be integral. 
[Take p>2, so that p — 1 is even.] Then c^"^ — 1 is divisible by c+l, and 
by the hypothesis for the induction, by p. Since c-\-l = h is relatively 
prime to p, / is an integer. 
"Novi Comm. Ac. Petrop., 8, 1760-1, p. 74; Comm. Arith., 1, 274-286; 2, 524-6. 
"Nova Acta Eruditorum, Lipsiae, 1769, 109. 
