60 History of the Theory of Numbers. [Chap, hi 
proved in 1681 (p. 50). Mahnke gave reasons (pp. 54-7) for believing 
that Leibniz rediscovered independently Fermat's theorem before he 
became acquainted, about 1681-2, with Fermat's Varia opera math, of 
1679. In 1682 (p. 42), Leibniz stated that (p-2)!=l (mod p) if p is a 
prime [equivalent to Wilson's theorem], but that {p—2)l=m (mod p), if 
p is composite, m ha\dng a factor > 1 in common wdth p. 
De la Hire^ stated that if k-'"^^ is divided by 2(2r+l) we get A; as a 
remainder, perhaps after adding a multiple of the divisor. For example, 
if kr' is divided by 10 we get the remainder k. He remarked that Carr^ 
had observed that the cube of any number /:<6 has the remainder k when 
divided by 6. 
L. Euler^ stated Fermat's theorem in the form: If n+1 is a prime divid- 
ing neither a nor h, then a" — 6" is divisible by n+1. He was not able to 
give a proof at that time. He stated the generaUzation : If e = p'"~Hp — 1) 
and if p is a prime, the remainder obtained on dividing a* by p"" is or 1 
[a special case of Euler^^]. He stated also that ii m, n, p,. . . are distinct 
primes not dividing a and if A is the 1. c. m. of m — 1, n — 1, p — 1, . . ., then 
o"* — 1 is divisible by mnp . . . [and a* — 1 by m'' n\ . .ii k = A rrC~^n^~^ . . .]. 
Euler^° first published a proof of Fermat's theorem. For a prime p, 
2'' = (l + l)^ = l+p-h(^)H-...+p+l = 2+mp, 
3P = (l+2)P = l+A:p+2^ 3^-3- (2^-2) = A:p, 
(1+0)"= 1+np+aP, (l+o)P-(l+a)-(aP-a)=np. 
Hence if a^—a is divisible by p, also (1+a)" — (1+a) is, and hence also 
(a+2)''-(a+2),. . ., (a+6)P-(a+6). For a = 2, 2" - 2 was proved divisible 
by p. Hence, wTiting x for 2+6, we conclude that x^—x is divisible by p 
for any integer x. 
G. W. Kraft^^ proved similarly that 2" — 2 = 7np. 
L. Euler's^- second proof is based, hke his first, on the binomial theorem. 
If a, 6 are integers and p is a prime, (a+6)"— a" — 6" is divisible by p. Then, 
if a^ — a and 6^ — 6 are di\'isible by p, also (a+6)" — a — 6 is di\4sible by p. 
Take h = \. Thus (a+1)"— a— 1 is divisible by p if a^—a is. Taking 
a = 1, 2, 3, ... in turn, we conclude that 2''— 2, 3"— 3, . . . , c^ — c are divisible 
by p. 
L. Euler^^ preferred his third proof to his earlier proofs since it avoids 
the use of the binomial theorem. If* p is a prime and a is any integer not 
*Hist. Acad. Sc. Paris, annee 1704, pp. 42-4; ra4m., 358-362. 
»Comm. Ac. Petrop., 6, 1732-3, 106; Coram. Arith., 1, 1849, p. 2. [Opera postuma, I, 1862, 
167-8 (about 1778)]. 
^••Comm. Ac. Petrop., 8, ad annum 1736, p. 141; Comm. Arith., 1, p. 21. 
"Novi Comm. Ac. Petrop., 3, ad annos 1*50-1, 121-2. 
"Novi Comm. Ac. Petrop., 1, 1747-8, 20; Comm. Arith., 1, 50. Also, letter to Goldbach, 
Mar. 6, 1742, Corresp. Math. Phys. (ed. Fuss), I, 1843, 117. An extract of the letter is 
given in Nouv. Ann. Math., 12, 1853, 47. 
"Novi Comm. Ac. Petrop., 7, 1758-9, p. 70 (ed. 1761, p. 49); 18, 1773, p. 85; Comm. Arith., 1, 
260-9, 518-9. Reproduced by Gauss, Disq. Arith., art. 49; Werke, 1, 1863, p. 40. 
