On the Sum of the Squares of Two Consecutive ntegers By Edward L. Cohent. ntroduction. Solutions of n2 + (n + l)2 = qk are examined, where q is a prime < 109, and fc is an integer > 1. Note from Hardy and Wright [1, p. 219, Theorem 252] that if e has in its factorization any prime = 3 (mod 4), then n2 + (n + l)2 ^ el for any (positive). So only the numbers that have prime factors = 1 (mod 4), have to be nsidered. Here, we deal only with primes q = 1 (mod 4), where q < 109, and a few other primes with 109 < q < 10. L. Aubry [2] proved that x2 + (x + iy ^ mk\ik is not a power of 2. Notice that l2 + 22 = 5, 32 + 42 = 52, 22 + 32 = 13, 1192 + 1202 = 134, 202 + 212 = 292, 42 + 52 = 41, and 52 + 62 = 61. Excluding these possibilities, there is the Theorem, n2 + (n + l)2 ^ qk for all primes q < 109. The theorem [3] was previously proven (in a slightly different manner) for q = 5. Observe that (1) n+ (n+ l)2 = qk is equivalent to (2) Z2 = 2-qk-l, for if Z = 2n + 1, (1) mes from (2), and if n = (Z l)/2, (2) mes from (1). Some facts are stated about Gaussian integers. The integers are of the form a + bi, where a and b are natural integers. Unique factorization holds, and the only units are +1, 1, +i, i.. Case 1: 41, 5, 13, 29, 37, 53, 61, 101, and 109. A special solution is required for every prime q in Case 1. We select 41 ; the results for all the primes in Case 1 are in Table, and their results can be mpared with those of 41. Let us factor (1) for q = 41 : [(n + 1) + ni][(n + 1) - ni] = (5 + 4 )*(5 - Ai)k = uk ~A, with the possible inclusion of some units. Should (n + 1) + ni or (n + 1) ni have as factors both 5 + Ai and 5 Ai, it would have a factor of 41. Hence, its real and imaginary parts, n+l and n, would both be divisible by 41, which is impossible. (A similar argument shall be omitted later.) Now, 42 + 52 = 41, so solutions with fc > 2 must be sought. The following lemma must first be proven. Lemma, n is a solution (=) n = 651 or 652 (mod 412). Proof. f n runs through the integers mod 41, namely 0, 1, 2, -, 40, then n2 + (n+ l)2 = 0 (mod 41) (=) n = 4 or n = 36 (i.e., -5) (mod 41). Received August 25, 1966. Revised November 21, 1966. t Present address: University of Ottawa, Ottawa 2, Canada. 460 License or pyright restrictions may apply to redistribution; see http://www.ams.org/journal-terms-of-use
SUM OF SQUARES OF TWO NSECUTVE NTEGERS (M Ci ï LO H O H Ll H O 1 * <D LO rïï ^3 'S H o m. i i^. CS i i i i O O ^ OiON i t Oí fh ce h O h ++ + N i Oí lo <M (Mi N- O0O3 1-O' ioa «o^w -* oí M * * 03 O S pq r- esa (MOKDlrHOO^rH i-h o O t>. oo 3 lo r~ >o lo lo r>- (NOOOrHrtNN o oo Oí 1.C LO o lo OlCCNrHH^rH icídh O, c M N O O lo H Tf rh ^h o l> * lo r~ >-i LO OÍ 0-1 i i i l, l s Ü +++++++++ (NMNtOlONOO LO Cí N i l C0 ^h < i C ^H(M-^»OO License or pyright restrictions may apply to redistribution; see http://www.ams.org/journal-terms-of-use
462 EDWARD L. HEN Suppose n ss 4 (mod 41). Then n = Air + A. Substituting this in n2 + (n + l)2 = 41*, the following is obtained: (3) 2-41r2+ 18r+ 1 = 41*_1, or r = -16 (mod 41), r = All - 16, and hence n = Al2l - 652. So n = -652 (mod 412). f n = 5 (mod 41), the same type of calculation shows that n m 651 (mod 412). Q.E.D. The above lemma can also be proved by using [4, p. 79]. n fact, [4] can be used to prove the lemma in the general case for a prime of the form At + 1. Now, (5 + Ai)k = Xk + iyk, so (4) (Xk+i + iyk+i) = (X, + 7,0(5 + Ai) = (5Xk - AYk) + (AXk + byk)i ; therefore, Xk+i = 5Xk AYk, and Yk+i = AXk + 5Yk. t can be seen that both Xt and Yk satisfy (5) Zk+2 = 10Zk+i - AlZk. LetZj = (A + A)/2 = [(5 + Ai)' + (5 - Ai)']/2. (Since [(» + 1) + ni][(n + 1) ni] [n + (n + l)i][n (n + l)i], we uld have the possibility that Zk either = ±n or ±(n + 1) mod 412; i.e., Zk = ±651 or ±652 (mod 412).) Thus, Z0 = 1, Zi = 5. We use Zo, Zh and the formula Zj+2 = 10Zj+i A1Z (mod 412). We say that a sequence is quasi-periodic when two successive residue classes repeat except possibly with a change of sign. By (5), the sequence is quasi-periodic, since Zi = Zioo (mod 412) and Z2 = Z20i (mod 412). The sequence repeats with a quasi-period of 205. Also, of Z0, Zh, Z2os only Z-n = ±651 or ±652. The table below indicates what we are interested in : fc addendum Zk Zk_i Zk-i 71-651 431 244 276 205-651 431 244 481 205-651 431 244 686 205-651 431 244 (Actually the sequence nnected with 41 is periodic, but the sequences nnected with 5, 13, 29, 53, 101, and 109 are quasi-periodic. Also, note that if p. = 4 + bi were used the same fc and addendum would be obtained.) Hence, it is shown that only 71, 71 + 1-205, 71 + 2-205, can yield solutions of n2 + (n + l)2 = 41*. We prove that this cannot happen. Notice that fc = 71 (mod 205). f 2-41* 1 is a square, then it is a quadratic residue for any modulus. This is an immediate nsequence of the definition of a quadratic residue. Since 41206 = 1 (mod 83), 2-41"-41206-8 - 1 = 53 (mod 83), s > 0. As 53 is a nonsquare (mod 83), it is proven that 2-41* 1 = 53 (mod 83) is a nonsquare for the relevant cases. This mpletes the proof. Tables and deal with 13 and 53 respectively. t was not possible to find one prime (like 83 above) with a rresponding nonsquare. Therefore, with 13 and License or pyright restrictions may apply to redistribution; see http://www.ams.org/journal-terms-of-use
SUM OF SQUARES OF TWO NSECUTVE NTEGERS 463 -f -r oi oo LO Ci afe; =c ^ «> OO ^ O ' - &^ i "^ na i OQ i-h Co t^ ^ oo lo ^ -o ÛQ 1 <A, OQ * > ^ S PQ < 03 o -* "o 93 LO *-fe O&0 * Co i i Co Co Co lo ï>; ' cc r- O ' ' ^ O oo o ^ oo O lo O O LO > 1~ t~ CQ -r LO Oi 1 05 > 1^ LO > 1^ i- -r LO os eo i-h a> > LO > o b- -r a^ &^ Äfe; ^ ^ ^ # ^ - 03 g O1 y. TÍ S re 1-! O O -t -or o o 73 c Ol -!- 73 c License or pyright restrictions may apply to redistribution; see http://www.ams.org/journal-terms-of-use
464 EDWARD L. HEN oo ^ "o ^> Ci CC < < CD > < 01 lo >. < < Ol ^ ÛQ > Ol "^ 0-1 *-< =C 0-1 ^ i i es 50 'o -o ^ LO Co oo * oo Ci 05 0 1 1 0-1 0-1 F- ^H > 0-1 "^ : =c 'O 'O 1^ - License or pyright restrictions may apply to redistribution; see http://www.ams.org/journal-terms-of-use
SUM OF SQUARES OF TWO NSECUTVE NTEGERS 465 53 several primes were used. To check whether a number is a square or a nonsquare modulo a prime, one can use quadratic residue theory [1, Chapter V].. Case 2 :17, 73, 89, 97, and Others Under 10. A special solution is required for every prime in Case 2. We select 17; the others are proved in the same manner. Let us factor (1) for q = 17: [(n + 1) + ni][(n + 1) - ni] = (A + i)k (A - i)k = pk-pk with the possible inclusion of some units. The following lemma is first proven. Lemma, n is a solution (=) n = 6 or 7 (mod 17). Proof. f n runs through the integers mod 17, namely 0, 1, 2, -, 16, then n2 + (n+ )2 = 0 (mod 17) <=) n = 6 or 10 (i.e., -7) (mod 17). Q.E.D. Now, (4 + i)k = Xk + iyk, so (6) (Xk+i + iyk+i) = (Xk + iyk)(a + i) = (AXk - Yk) + (Xk + AYk)i ; therefore, Xk+i = AXk Yk, and Yk+i = Xk + AYk. t can be seen that both Xk and Yk satisfy (7) Zk+2 = 8Zk+i - 17Zk. Let Z = 0' + po/2 = [(4 + i)' + (A - i)']/2. These give Z0 and Zi. We use Zo, Zi, and the formula Zj+2 = 8Zy+i 17 Zj (mod 17). The sequence is quasiperiodic with quasi-period 4. We have Zo Zi Z2 Zs Zi Zf, Zo i, 1 4-2 1 8-4 2-1,--- which does not give ±6, ±7. Other Primes in Case 2. Other primes q in Case 2 < 109 are 73, 89, and 97. The primes in Case 2 with 109 < q < 10 are 157, 193, 233, 241, 257, 281, 337, 349, 353, 401, 409, 433, 449, 461, 541, 577, 601, 617, 641, 661, 673, 709, 769, 821, 881, 929, 937, and 977. The proofs are omitted. V. Acknowledgments. An BM 7030 mputer was used extensively in the calculations. am grateful to Paul Hamburger of MTRE, who shortened the output of one of my programs nsiderably. The MTRE Corporation Bedford, Massachusetts 1. G. H. Hardy & E. M. Wright, An ntroduction to the Theory of Numbers, 3rd ed., Clarendon Press, Oxford, 1954, 1962. MR 16, 673. 2. L. Aubry, L'intermédiaire des math., 18, 1911, pp. 8-9, errata pp. 112-113; Sphinx-Oedipe, numero special, March 1914, pp. 15-16, errata p. 39. 3. C. Engleman, "On close-packed double error-rrecting des on p symbols," RE Trans. nform. Theory," v. T-7, 1961, pp. 51-52. MR 23 #B3075. 4. D. Shanks, "A sieve method for factoring numbers of the form n2 + 1," MTAC, v. 13, pp. 78-86. MR 21 #4520. License or pyright restrictions may apply to redistribution; see http://www.ams.org/journal-terms-of-use