360 History of the Theory of Numbers. [Chap, xiv 
quadratic residues of p. Then r-\-x'^=ai (mod p). Thus a, — r must be 
a quadratic residue. Reject from Oi, . . . , a^ the terms for which a^ — r is not 
in the set. We get the possible residues of x modulo p. His method to fac- 
tor 0"=*= 1 is the same as Dickson's^^^ and is applied to show that the factor 
(273_|_237 4-i)/(5.239-9929) of 2"^+l is a prime in case it has no factor 
between 10500 and 108000. 
Kraitchik" extended the method of Lawrence. 
F. J. Vaes^^ applied his^^ method to factor Mersenne's^ number. The 
same was factored by various methods in L'lnterm^diaire des Math6mat- 
iciens, 19, 1912, 32-5. J. Petersen, ibid., 5, 1898, 214, noted that its product 
by 8 equals k^+k, where A: = 898423. 
Method of Factoring by Sum of Two Squares. 
Frenicle de Bessy^^ proposed to Fermat that he factor h given that 
h = a^+b''-=c'+(f, as 221 = 100+121 = 196+25. 
In 1647, Mersenne^^ (of Ch. I) noted that a number is composite if it be 
a sum of two squares in two ways. 
L. Euler^^ noted that iV is a prime if it is expressible as a sum of two 
squares in a single way, while if iV = a^+5^ = c^+d^, N is composite : 
{{a-cY+{h-d)'} {{a+cy+ih-d)'] 
4(6 -d)2 
Euler^' proved, that, if a number A'" = 4n+1 is expressible as the sum of 
two relatively prime squares in a single way, it is a prime. For, if iV were 
composite, then N={d^-{-b^){c^+d^) is the sum of the squares of ac^bd and 
ad=f^bc, contrary to hypothesis. If iV = a^+6^ = c^+d^, N is composite; 
for if w^e set a = c-\-x, d = b-\-y, and assume* that the common value of 
2cx-\-x^ and 2by-\-'if' is of the form xyz, we get 
2c = yz-x, 2b = xz-y, N = b'^+c^+xyz = \{x'^-]-y^){l+z^), 
whence x^-\-y^ or {x^+y^)/4: is a factor of N. To express iV as a sum of two 
squares in all possible ways, use is made of the final digit of N to limit the 
squares x^ to be subtracted in seeking differences N — x^ which are squares. 
Several numerical examples of factoring are treated in full. 
Euler-^ gave abbreviations of the work of applying the preceding test. 
For example, if 4n+l=5m+2 = x^+!/^, then x and y are of the form 
"Sphinx-Oedipe, 1912, 61-4. 
i^L'enseigncment math., 15, 1913, 333-4. 
"Oeuvres de Fermat, 2. 1894, 232, Aug. 2, 1641. 
"Letters to Goldbach, Feb. 16, 1745, May 6, 1747; Corresp. Math. Phys. (ed., Fuss), I, 1843, 
313, 416-9. 
"Novi Comm. Ac. Petrop., 4, 1752-3, p. 3; Comm. Arith., 1, 1849, 165-173. 
*Euler gave a faultless proof in the margin of his posthimious paper, Tractatus, §570, Comm. 
Arith., 2, 573; Opera postuma, I, 1862, 73. We have {a+c)ia-c) = {b+d){d-b) =pqrs, 
a+c = pq,a—c = rs, b+d = pr, d—b = qs [since, if pbe theg. c. d. of a+c, b+d, then g(a—c) 
is divisible by r, whence a—c = rs]. Hence a2+6^ = (p*+a^)(g'+r')/4. 
»»Novi Comm. Ac. Petrop., 13, 1768, 67; Comm. Arith., 1, 379. 
