CHAP. VIII] SUM OF FOUR SQUARES. 281 



Multiply the last equation by Q = b (A ~ 1)l2 + 1. If p and q can be chosen 

 so that pPQ is not divisible by A, then p z b will be divisible by A, as 

 shown by using Fermat's theorem. For q constant and p = 1, , A 2, 

 let P become PI, -, P A -z- Then by the theory of differences, 



P! - (A - 3)P 2 + (A - 3)(A - 4)P 3 - + P A - 2 = (A - 3)!. 

 Hence at least one P t is not divisible by A. Set m = %(A 1). Then 

 Q = q 2 R + C m + 1, R = B m q A ~ s + mB m ~ l q A - 5 C + + mBC m ~ l . 



If C m + 1 is not divisible by A, it suffices to take 2 = 0. In the contrary 

 case, we note that if R becomes Ri for q = i, 



R,- (A- Z)R 2 + f (A - 3) (A - 4)# 3 -.+ R A . Z = (A - 3)! 5", 



so that at least one Ri is not divisible by A. Hence by (iv) every prune is 

 a 3D. 



(vi) Every positive integer is the sum of four or fewer squares. 



This follows from Euler's relation (1). Lagrange added the generaliza- 

 tion 



(p 2 - Bq 2 - Cr 2 + BCs 2 }(p] - Bq\ - Cr\ + BCs\] 



(4) = { PPl + Bqq, Cfa + BssJ } 2 - B{pq, + q Pl C(ri + TI) } 2 

 C{pr l Bqsi rpi =F 5s^i} 2 + BC{qri psi spi T r^i} 2 . 



L. Euler's 10 proof is much simpler than Lagrange's. It is shown that if 

 N divides P = p 2 + q 2 + r 2 + s 2 , but not all the numbers p, , s, then 

 Af is a sum of four squares. Set P = Nn. Determine o, 6, c, d, each 

 numerically < |n, so that 



p = a + na, q = b + nfi, r = c + ny, s = d + n8. 



Set a- = a? + b 2 + c 2 + d 2 . Then a- ^ n*. We readily dispose of the case* 

 a = ri 2 . [If n is odd, a, , d may be chosen numerically < n/2, whence 

 ff < n 2 . If n is even, we have a- < n 2 unless o, , d numerically equal 

 n/2, whence p db q and r db s are divisible by n and are even. But 

 Nn = P = Sp 2 , whence 



, K x - 2 - 



(5) 



may be used in place of the initial multiple P of A 7 ".] Hence let a- < n z . 

 Then 



Nn = ff + 2nA + n\ A = aa + bp + cy + d8, t = a 2 + p + y 2 + 5 2 . 



Thus o- is divisible by n. Set a- nn', so that n r < n. By (1), 



erf = A 2 + B 2 + C 2 + Z> 2 . 

 Multiply N = n' + 2A +ntby n'. Then 



A/V = (ri + A) 2 + B 2 + C 2 + > 2 . 



10 Acta Erudit. Lips., 1773, 193; Acta Acad. Petrop., 1, II, 1775 [1772], 48; Comm. Arith., 

 I, 543-4. Euler's Opera postuma, 1, 1862, 198-201. He first repeated Lagrange's proof 

 and his 8 proof of Theorem I. 



* Stated to occur only when o = 6=c = d = |n = l, whence p, -,r are odd and N = fP 

 equals the right member of (5). 



