CHAP. VIII] SUM OF FOUR SQUARES. 279 



Resolve e-B into two factors a, b, both even or both odd. Then for 

 x = e/a, d = A + (a b)/2. Take k, m, n arbitrarily and determine 

 a b, or conversely. The case e = 8 was partially treated by Goldbach, 

 pp. 540, 546-8, 555 and by Euler, p. 557. A ffl with the sum of the roots 

 zero is a SI since (pp. 548-9) 



a 2 + b 2 + c 2 + (a + b + c) 2 = (a + 6) 2 + (a + c) 2 + (b + c) 2 . 

 Goldbach (p. 548) noted that 



8n + 4 = a 2 + 6 2 + c 2 + d 2 , a + 6 + c + d = 2. 

 Euler, Sept. 4, 1751, p. 551, deduced this from 



Sn + 3 = O = (a + b - I) 2 + (a + c - I) 2 + (b + c - I) 2 . 



Euler 8 published some results on Bachet's theorem. He proved 



THEOREM I. There exist integers a, b for which 1 + a 2 + b 2 is divisible 

 by a given prime p. For, if 1 is a quadratic residue of p, there is an 

 integer a for which 1 + a 2 is divisible by p. Next, let 1 be a non- 

 residue and suppose the theorem is false. Then 1 + 12 = shows 

 that 2 is a non-residue and hence + 2 a residue; then 1 + 2 3 = 

 shows that 3 is a non-residue and hence + 3 a residue; and in this way 

 1, 2, , p 1 would all be residues. 



If A = a 2 + + d 2 , P = p 2 + . , then A/P = AP/P 2 = (x/P) 2 + - 

 by (1), so that A/P is the sum of four rational squares. Euler admitted 

 he was unable to prove that, if A is divisible by P, A/P is the sum of four 

 integral squares. If this were proved, Bachet's theorem would follow. 

 But it is readily proved that every integer is a sum of four rational squares. 

 For, if p be the least prime not such a sum, there exists (Theorem I) an 

 integer A = a 2 + b 2 + c 2 divisible by p, where a, b, c are < p/2. Then 

 A/p < fp, and yet Afp was seen to be the sum of four rational squares. 



J. L. Lagrange 9 gave the first proof of the theorem of Bachet and 

 acknowledged his indebtedness to ideas in the preceding paper by Euler. 

 The steps are as follows: 



(i) If p 2 + q 2 = tp and r 2 + s 2 = up, where p, q, r, s have no common 

 divisor, then t and u are sums of two squares. 



For, call M the g.c.d. of p = Mpi and q = Mq : ' } N that of r = Nr t and 

 s = Nsi. Then M and N are relatively prime. Call /* the g.c.d. of M 2 

 and p = npi. Since 

 (2) M 2 (pl + rf) = Wi, 



Pi divides the sum p\ + ql of two relatively prime squares. By Euler's 24 

 theorem of Ch. VI, the quotient is a sum c 2 + d 2 of two squares. Set 

 M = vVi> where ^i has no square factor. Then M is divisible by pp lt 

 M = Kvfj.1. Now N 2 (rl + sj) = Ufj.pi. Since M divides M 2 , it is prime to 

 Af 2 and hence divides r\ + s\. As before, ^i = e 2 +/ 2 . Then, by (2), 



t = (c 2 + d 2 )M 2 /n = (c 2 + d 2 )K 2 Ml = K\ec + fd) 2 + K 2 (ed - /c) 2 . 



8 Novi Comm. Ac&d. Petrop., 5, 1754-5 (1751), 3; Comm. Arith., I, 230-233. 

 9 Nouv. M4m. Acad. Roy. Sc. de Berlin, ann6e 1770, Berlin, 1772, 123-133; Oeuvres, 3, 

 1869, 189-201. Cf. G. Wertheim's Diophantus, pp. 324-330. 



