CHAP. VII] SUM OF THREE SQUARES. 263 



ways, counting two for each case of three distinct squares, then the number 

 of decompositions in which one or three of the ra's are even equals that in 

 which one or three of the m's are odd. But for 36 2 the first number exceeds 

 the second if and only if b = 1 (mod 4), the excess being always Q>/3]. 

 If N is any odd integer, (2) shows that 



3N 2 = (6m + I) 2 + (6mi + I) 2 + (6m 2 + I) 2 



hi more than one way if N > 1, so that the squares need not all be equal. 

 Thus 



N 2 = ri* + 2nl + &nl, n = 2(ra + w t + ra 2 ) + 1, 



HI = 2m mi m z , n 2 = mi m 2 , 



where n { and n% are not both zero. By changing the sign of n if necessary, 

 we may assume that N n is divisible by 4. Let N be a prime. Then 

 (N n)/4 and (N + ri)/2 are relatively prime and each divides n\ + %nl, 

 whence each are of the latter form: 



i(N + n) = a 2 + 3 T 2 , l(N - n) = 2 + 35 2 . 



Hence every prime can be expressed in the form c? + 2/3 2 + 3? 2 + 65 2 . 

 Since the product of two such expressions is of the same form, every number 

 can be expressed in that form. 



G. L. Dirichlet 24 remarked that, by use of his formulas for the number 

 h of classes of binary quadratic forms, one can give a new expression for 

 the number <J>(m) of proper representations of m as a SI (Gauss 20 ). Accord- 

 ing to G. Eisenstein, 25 the result is 



[W/4J / Q \ 



4>(m) = 24 ( - , if m = 1 (mod 4); 

 s=i \ m I 



[TO/2J / \ 



0(m) = s Z - , if m = 3 (mod 4), 

 =i \m/ 



where (s/m) is Jacobi's symbol and is if s, m have a common factor. 



T. Weddle 26 noted that, if (a, p, z), (b, q, z'} and (c, r, z") are the extremi- 

 ties of a system of conjugate semi-axes of an ellipsoid, 



(a 2 -H 6 2 + c 2 )(p 2 + q 2 + r 2 ) = (aq - 6p) 2 + (or - cp) 2 + (br - eg) 2 . 



J. R. Young 27 noted that the last formula follows by taking d = s = 0, 

 ap + bq + cr = in Euler's formula (1) of Ch. VIII. But if we take 

 d = s = 0, afp = bfq, we get 



(a 2 + 6 2 + c 2 )(p 2 + q 2 + r 2 ) = (ap + bq + cr) 2 + (ar - cp) 2 + (br - eg) 2 . 



G. L. Dirichlet 28 gave an elegant proof of Legendre's 19 theorem. Let 

 a be a positive integer not of one of the forms 4n, 8n + 7. It suffices to 



24 Jour, fur Math., 21, 1840, 155; Werke, 1, 1889, 496. 



25 Jour, fur Math., 35, 1847, 368. Cf. T. Pepin, Atti Accad. Pont. Nuovi Lincei, 37, 1883- 



4,44. 



26 Cambridge and Dublin Math. Jour., 2, 1847, 13-19. 



27 Trans. Irish Acad., 21, II, 1848, 330. 



28 Jour, fur Math., 40, 1850, 228-232; Werke, 2, 1897, 91. French transl. by J. Houel, Jour. 



de Math., (2), 4, 1859, 233. 



