New demonstrations about the resolution of numbers into squares
aa r X i v : . [ m a t h . HO ] M a y New demonstrations about the resolution ofnumbers into squares ∗ Leonhard Euler
1. Though I have been occupied with this argument intensely and often, still,the demonstration which I gave previously about the resolution of all numbersinto four or fewer squares had not been altogether satisfactory to me. Thus Ihave pursued with all the greater ardor the demonstration which the CelebratedMr. Lagrange has recently given in the first volume of the Berlin
M´emoires ofthis theorem, which I judge to completely settle the matter, even if it seems todemand much effort and be very laborious.2. I believe however that it will be hardly unwelcome to readers if I relatebriefly and clearly the particular points on which Lagrange’s demonstration isbased. After the Celebrated Author gives the lemma that if two sums of twosquares pp + qq and rr + ss have a common divisor ̺ which does not divide all theindividual squares, then not only this divisor ̺ itself, but also both the quotients pp + qq̺ and rr + ss̺ will be sums of two squares, he proceeds to the theorem to bedemonstrated, that if a sum of four squares P + Q + R + S is divisible byany number A which does not divide all the individual squares, then the number A itself will be a sum of four squares , whose demonstration is contained in thefollowing reasoning.I. Putting the quotient arising from this division = a , so that Aa = P + Q + R + S , if it turns out that the two formulas P + Q and R + S have a commondivisor ̺ , then since the number a will also contain it , one puts a = b̺ . Thus ∗ Presented to the St. Petersburg Academy on March 24, 1774. Originally published as
Novae demonstrationes circa resolutionem numerorum in quadrata , Nova acta eruditorum(1773), 193–211. E445 in the Enestr¨om index. Translated from the Latin by Jordan Bell,Department of Mathematics, University of Toronto, Toronto, Ontario, Canada. Email: [email protected] Translator: Euler is implicitly taking A prime, and indeed he only uses this result for A prime. This is false for A composite. Playing around in Maple I found the example P = 219 , Q = 192 , R = 255 , S = 402, and A = 3 · A divides P + Q + R + S but doesnot divide all of P, Q, R, S ; in fact it divides none. However, both P + Q and R + S aredivisible by ̺ = 3. Thus here it does not follow that ̺ divides a = 2 · .
1t becomes Ab = P + Q ̺ + R + S ̺ ;since by the stated lemma these formulas are sums of two squares, an equationof this kind will be obtained Ab = pp + qq + rr + ss, where the formulas pp + qq and rr + ss will no longer have a common factor.II. Then indeed it is put pp + qq = t and rr + ss = u , so that Ab = t + u ,which by multiplying by t leads to the equation Abt = tt + tu ; and because tu is also a sum of two squares, call it say xx + yy , by taking namely x = pr + qs and y = ps − qr it will become Abt = tt + xx + yy. III. Now it is observed that both x and y can thus be expressed by thenumbers t and b , which of course are mutually prime, as x = αt + γb and y = βt + δb ; where although there are infinitely many ways the letters α, β, γ, δ can be taken as either negative or positive, among which certain values are givenso that α < b and β < b .IV. Now substituting these values for x and y , this equation will result Abt = tt (1 + αα + ββ ) + 2 bt ( αγ + βδ ) + bb ( γγ + δδ ) . While this expression should be divisible by b , however in the first term tt doesnot admit this division , so it is necessary that the formula 1 + αα + ββ hasthe factor b ; as well, in the same way it is necessary in the last term that thefactor γγ + δδ be divisible by t . Let it therefore be put 1 + αα + ββ = ba ′ , andbecause each number α and β is less than b , it is clear that a ′ < b + b ; thendividing by b it will be At = a ′ tt + 2 t ( αγ + βδ ) + b ( γγ + δδ ) . V. Now let this equation be multiplied by a ′ , so that it becomes Aa ′ t = a ′ tt + 2 a ′ t ( αγ + βδ ) + a ′ b ( γγ + δδ ) , and in the last term by writing 1 + αα + ββ in place of a ′ b it becomes Aa ′ t = a ′ tt + 2 a ′ t ( αγ + βδ ) + ( αα + ββ )( γγ + δδ ) + γγ + δδ. Translator: This is referring to the result stated in § Translator: Since Ab = t + u where t and u are relatively prime. Aa ′ t = ( a ′ t + αγ + βδ ) + ( βδ − αδ ) + γ + δ ;where since the sum of the latter two squares γ + δ is divisible by the number t , it is necessary that the sum of the first two is also divisible by t , so that heretwo sums of two squares occur having a common divisor t ; whence if they aredivided by t , both their quotients will likewise be sums of two squares.VI. But if we thus put( a ′ t + αγ + βδ ) + ( βγ − αδ ) t = p ′ + q ′ and γ + δ t = r ′ + s ′ , we will have Aa ′ = p ′ + q ′ + r ′ + s ′ . As well, in this formula Aa ′ , if it is compared with the first Aa , the number a ′ will be much smaller than a , since b < a and a ′ < b . In a similar way, we canget to a formula Aa ′′ , where a ′′ will be much smaller than a ′ , and thus finallyit is necessary that the formula A · A isfound to be equal to a sum of four squares.3. In order to demonstrate this theorem it is also necessary to show thatfor any given prime number a sum of four squares can be exhibited which isdivisible by that prime, but which are not all divisible by the prime. Andindeed the Celebrated Lagrange also demonstrates this in a very ingenious way,which however is abstruse and lengthy, so that his efforts are not revealed asbriefly and clearly as could be desired. Now therefore, the famous theorem ofBachet or Fermat, that any number can be resolved into four squares , is obtainedby a perfect demonstration. Since for any prime number a sum of four squarescan always be given which is divisible by it, all prime numbers will be sums offour or fewer squares, and because it was formerly already demonstrated thatthe product of two or more numbers, each of which is a sum of four or fewersquares, can itself also be divided into four squares, it has now been establishedmost securely that all numbers whatsoever are the sum of four or fewer squares.4. Although to be sure it would be a sin to remove anything from thesolidity and rigor of these demonstrations, nevertheless no one will deny thatthe foundations and rules of all the reasoning by which these demonstrationsare composed is rather lengthy, and I have not been able to fully remove theobscurity involved, so that even still clearer and easier demonstrations could bedesired.5. After I had carefully studied this new argument, new and rather straightforward demonstrations of these theorems occurred to me, which are useful inthis pursuit. The publication of these new demonstrations surely seems worth-while; I will relate these here as briefly and clearly as I am able. I shall first takeup that well known and fully demonstrated theorem that all divisors of a sum of3wo relatively prime squares are themselves equal to a sum of two squares, sincethis new demonstration commends itself by its simplicity. Then by following inthe same footsteps the demonstration will be easily extended to four squares. Lemma 1 A product of two sums of two squares is itself a sum of two squares.
For if that product were ( aa + bb )( αα + ββ ) and one takes A = aα + bβ and B = aβ − bα, it will certainly be ( aa + bb )( αα + ββ ) = AA + BB.
Theorem 1
If a number N is a divisor of a sum of two squares P + Q which are primeto each other, then that number N will itself be a sum of two squares. Demonstration
In order to work out this demonstration with more manageable numbers, Iobserve that however large the numbers P and Q are, from them a sum of twosquares pp + qq can always be formed whose roots p and q do not exceed halfof the given number N . For if one puts P = f N ± p and Q = gN ± q, it is familiar that numbers p and q can be taken as not to exceed the half N .Now since it would then be P P + QQ = N N ( f f + gg ) + 2 N ( ± f p ± gq ) + pp + qq and this expression would be divisible by N , it is evident that this sum of twosquares is also divisible by N . With this stated, I will complete the demonstra-tion by the following steps.I. Since this formula pp + qq has the divisor N , by putting the quotient = n we will have N n = pp + qq, where therefore n will be less than N , because p < N and q < N .4I. Now these numbers p and q can be expressed by the number n such that p = a + αn and q = b + βn, where by also admitting negative numbers for a and b it will be possible toreduce these below n , as we observed initially. Then indeed it will be N = naa + bb + 2 n ( aα + bβ ) + nn ( αα + ββ ) , and because in the stated lemma it was aα + bβ = A , it becomes N n = aa + bb + 2 nA + nn ( αα + ββ ) . III. Therefore the first part aa + bb of this expression necessarily has a factor n , because the other part just by itself admits the divisor n . Therefore let usset aa + bb = nn ′ , and because a < n and b < n and then nn ′ < nn , it will obviously be n ′ < n . Substituting in this value and dividing by n yields N = n ′ + 2 A + n ( αα + ββ ) . IV. We multiply this equation by n ′ , and because nn ′ = aa + bb , by thestated lemma the latter part reduces to nn ′ ( αα + ββ ) = ( aa + bb )( αα + ββ ) = AA + BB, so that we will now have
N n ′ = n ′ n ′ + 2 n ′ A + AA + BB ;this expression is clearly a sum of two squares, namely N n ′ = ( n ′ + A ) + B . V. Thus as at first it had been that the product
N n was a sum of two squaresand from it we elicited a smaller product
N n ′ also equal to a sum of two squares,in this way continually smaller products can be led to, namely N n ′′ , N n ′′′ etc.Thus it is necessary that finally a minimum product, namely N ·
1, is reached,and thus this given number N will also be a sum of two squares. Corollary
5t seems perhaps wonderful that when a number of the type n ′ = 1 has beenreached, the same operations can be applied; this is easily seen by taking n = 1,for then one will obtain p = a + α · q = b + β ·
1, where one clearly takes a = 0 and b = 0, which of course are < ; then indeed as aa + bb = 0, it will ofcourse be n ′ = 0 and so this last step spontaneously ends our calculation. Scholion
It can be demonstrated in the same way that all numbers of the form pp +2 qq or pp + 3 qq do not admit any other divisors except those of the same form, ifindeed the numbers p and q are prime to each other. In truth however thiscalculation cannot be extended to higher forms, such as pp + 5 qq, pp + 6 qq ,because then the number n ′ that is sought is no longer necessarily less than n .Thus let us take up here the demonstrations of the former cases. Lemma 2 A product of two numbers of the form pp + 2 qq is always a number of thissame form. For if such a product is given ( aa + 2 bb )( αα + 2 ββ ) and one takes A = aα + 2 bβ and B = aβ − bα, then it will of certainly be AA + 2 BB = ( aa + 2 bb )( αα + 2 ββ ) . Theorem 2 If N is a divisor of the number pp + 2 qq , and p and q are prime to eachother, then this number N will also be contained in such a form. Demonstration
Here again the numbers p and q can be kept below half of the number N ,and our demonstration will proceed in the following way.I. Let N n = pp + 2 qq, Translator: My best translation of this paragraph is that it is remarkable how this methodof descent stops once we hit n ′ = 1, and that Euler is showing explicitly what happens oncewe hit n ′ = 1. p < N and q < N , it will be n < N . Now let us put as before p = a + αn and q = b + βn, where a and b can be taken less than N , and then we will have N n = aa + 2 bb + 2 n ( aα + 2 bβ ) + nn ( αα + 2 ββ );by the previous lemma this form is reduced to N n = aa + 2 bb + 2 nA + nn ( αα + ββ ) . II. Here therefore the first part aa + 2 bb will have a factor n , whence byputting aa + 2 bb = nn ′ it will certainly be n ′ < n . Now by substituting this value and by dividing by n it will become N = n ′ + 2 A + n ( αα + 2 ββ ) . III. Let us multiply by n ′ , and then by the previous lemma we will have nn ′ ( αα + ββ ) = ( aa + 2 bb )( αα + 2 ββ ) = AA + 2 BB, so that we shall now have
N n ′ = n ′ n ′ + 2 n ′ A + AA + 2 BB ;this form clearly reduces to N n ′ = ( n ′ + A ) + 2 BB, and hence likewise a number of the form pp + 2 qq .IV. Therefore since n ′ < n , in the same way successive products N n ′′ , N n ′′′ etc. can be reached such that the numbers n, n ′ , n ′′ , n ′′′ etc. continually de-crease. Therefore it is at last necessary to reach the form N ·
1, so that thenumber N is itself contained in the same form pp + 2 qq too. Lemma 3 A product of two numbers of the form pp + 3 qq can always be reduced tothe same form. For let such a product be ( aa + 3 bb )( αα + 3 ββ ) and take A = aα + 3 bβ and B = aβ − bα ;one will clearly have AA + 3 BB = ( aa + 3 bb )( αα + 3 ββ ) . heorem 3 If N is a divisor of the number pp + 3 qq , where p and q are numbers whichare prime to each other, then this number N will always be able to be reducedto the same form. Demonstration
Since again it can be considered p < N and q < N , this form pp + 3 qq will be less than N . Then by putting pp + 3 qq = N n the factor n will be less than N , though in fact this reduction is not necessaryfor the demonstration; for it can proceed the same, even if it were n > N , asfollows.I. Now by putting p = a + αn and q = b + βn these numbers a and b can be set less than n , at least not greater; then it willfurther be N n = aa + 3 bb + 2 n ( aα + 3 bβ ) + nn ( αα + ββ ) , which by the previous lemma is N n = aa + 3 bb + 2 nA + nn ( αα + 3 ββ ) . II. It is therefore necessary that the first part aa +3 bb have a factor n ; whenceby putting aa + 3 bb = nn ′ this number n ′ will surely be less than n , at least not greater; then indeedcarrying out division by n yields N = n ′ + 2 A + n ( αα + 3 ββ ) . III. Now let us multiply by n ′ , and the latter part nn ′ ( αα + 3 ββ ) = ( aa + 3 bb )( αα + 3 ββ )by the previous lemma is AA + 3 BB , and thus we will have N n ′ = n ′ n ′ + 2 n ′ A + AA + 3 BB ;8his expression clearly reduces to N n ′ = ( n ′ + A ) + 3 BB.
IV. Therefore since
N n ′ is again of the form pp +3 qq and n ′ < n , in the sameway continually smaller products N n ′′ , N n ′′′ etc. can be advanced to, until atlast the last N · N isof the form pp + 3 qq . Corollary 1
The basis of this demonstration, like for the preceding, consists in that forany number n , another smaller n ′ is reached, which is clear by itself in thosecases where n is large enough. This rule even works in the case where n = 1; forthen one can take a = 0 and b = 0, whence nn ′ = 0 which will make it n ′ = 0.Nevertheless clearly a singular case occurs for this theorem when two endsup being reached in the progression of numbers n, n ′ , n ′′ etc.; this case meritsmore attention because it does not otherwise occur. Corollary 2
Therefore in the first case let us put n = 2 and it is clear that in the formula pp + 3 qq both the numbers p and q must be odd; for both cannot be assumedto be even, since p and q have been assumed to be prime to each other. Andsince here it is p = a + 2 α and q = b + 2 β , it will become a = 1 and b = 1 andhence aa + 3 bb = 4 = nn ′ , from which it is clear that n ′ will be = 2, so that nofurther diminution can occur here. Corollary 3
Here this might become more clear if we reflect that the formula pp + 3 qq ,when both the numbers p and q are odd, not only cannot be even, but alsois divisible by 4, thus no oddly even number can be of the form pp + 3 qq .Therefore whenever, as occurs in these cases, the number 2 N is contained inthe form pp + 3 qq , then N will always be an even number of which half, N ,or a quarter part of 2 N , will be contained in the form pp + 3 qq . For wheneverboth of the numbers p and q are odd, then too pp +3 qq is always a number ofthe same form, and even in integers, which is not as easy to see. For by putting p = 2 r + 1 and q = 2 s + 1, this formula follows pp + 3 qq r + rr + 3 s + 3 ss, However this resolution can be done in general in the following way. For Iobserve that all odd squares are contained in the form (4 m + 1) , if indeednegative numbers are also admitted for m ; if on the one hand m were positive,the squares of the numbers 1 , , ,
13 etc., which are of the form 4 i + 1, result;on the other if m were a negative number, then the squares of the numbers3 , , ,
15 etc., which are of the form 4 i −
1, arise. Now let us put pp = (4 r + 1) and qq = (4 s + 1) and it will be pp + 3 qq r + 4 rr + 6 s + 12 ss, which clearly can be put into this form(1 + r + 3 s ) + 3( r − s ) . Scholion
Let us now advance to the demonstration of the stated theorems, especiallythat which is our main object, that a sum of four squares admits no other divi-sors except those which are a sum of four squares . Like the preceding theoremsit will also be useful to give this lemma. Lemma 4 A product of two or more numbers, each of which are a sum of foursquares, can always be expressed as a sum of four squares.
Let such a product be( aa + bb + cc + dd )( αα + ββ + γγ + δδ )and let us take A = aα + bβ + cγ + dδ,B = aβ − bα − cδ + dγ,C = aγ + bδ − cα − dβ,D = aδ − bγ + cβ − dα Translator: I think Euler means that 1+ r + rr +3 s is not necessarily a square, for example r = 1 and s = 1 gives 6 + 3 ·
1, which is not a square by three times a square. But of course9 = 3 + 3 · Translator: In § A + B + C + D = ( a + b + c + d )( α + β + γ + δ );for it is clear that all the products of two parts destroy each other, and all thesquares of the Latin letters are multiplied by all the squares of the Greek letters. Theorem 4 If N is a divisor of any sum of four squares, that is of the form pp + qq + rr + ss , each of which indeed are not divisible by N , then N will certainly be asum of four squares. Demonstration
It will be of no small help to have noted that these four roots p, q, r, s can bekept below half the given number N ; then the demonstration proceeds in thefollowing way.I. With n denoting the quotient from dividing by this, so that N n = pp + qq + rr + ss, where the letters p, q, r, s may be related thus to np = a + nα, q = b + nβ, r = c + nγ, s = d + nδ, where it is completely obvious that the letters a, b, c, d can be taken so as notto exceed n , since negative values are not excluded here. And so the formula aa + bb + cc + dd will certainly be less than nn .II. With these values substituted into our equation, it will be N n = aa + bb + cc + dd + 2 n ( aα + bβ + cγ + dδ ) + nn ( αα + ββ + γγ + δδ ) , which by the stated lemma, where we put A = aα + bβ + cγ + dδ, is contracted thus N n = aa + bb + cc + dd + 2 nA + nn ( αα + ββ + γγ + δδ ) . Thus because the first part aa + bb + cc + dd should have a factor n , let us put aa + bb + cc + dd = nn ′ n ′ < n , like we just showed. By dividing by n we willthen obtain N = n ′ + 2 A + 2 n ( αα + ββ + γγ + δδ ) . III. Let us now multiply by n ′ , and because nn ′ = aa + bb + cc + dd , we willhave from the preceding lemma nn ′ ( αα + ββ + γγ + δδ ) = A + B + C + D ;having introduced this form, our equation will be N n ′ = n ′ n ′ + 2 n ′ A + A + B + C + D , which clearly can be reduced to these four squares N n ′ = ( n ′ + A ) + B + C + D . IV. Therefore since n ′ < n , in the same way we can reach continually smallerforms N n ′′ , N n ′′′ etc., until finally we arrive at the form N · N is equated to four squares. Corollary 1
This calculation is again guilty of a minor exception, namely whenever itis n = 2 and all the numbers p, q, r, s are odd; for then it will happen that a = 1 , b = 1 , c = 1 and d = 1, so it would also happen that n ′ = 2 and so notless than n . Truly when the number 2 N is equal to a sum of four squares, it isclear from elsewhere that half of it, N , is a sum of four squares, and thus thatthis exception should clearly not be considered to disturb anything. Corollary 2
So that we can see this clearly, let the numbers p, q, r, s be odd and thenumber n be even; then, because N n = pp + qq + rr + ss , it will be12 N n = (cid:16) p + q (cid:17) + (cid:16) p − q (cid:17) + (cid:16) r + s (cid:17) + (cid:16) r − s (cid:17) , and these four squares are likewise integers; it will be possible to use this reduc-tion as long as all the roots of the four squares are odd; for then the exceptionmentioned before falls down by itself. Scholion
12y this demonstration this great theorem of Fermat is completed, since theother part which is still left, namely that given any number a sum of four squarescan be exhibited which is divisible by it, has been obtained clearly enough bymyself for a while already, and has recently been confirmed by a most exactdemonstration by the Celebrated Lagrange. However so that I can thoroughlycomplete this argument, I will adjoin the following very easy demonstration.
Theorem 5
Given any prime number N , not only four squares but even in fact threesquares can be exhibited in infinitely many ways whose sum is divisible by thisnumber N , but no single one can be divided by it. Demonstration
With respect to the number N , clearly all numbers are contained in one ofthe following forms λN, λN + 1 , λN + 2 , λN + 3 , . . . , λN + N − , the number of which is N . But disregarding the first form, which contains themultiples of N , it is noted for the remaining, the number of which is N − λN + 1 and the last λN + N − λN + 1; and indeed the squares of the second form λN + 2 andthe second to last form λN + N − λN + 4; and indeed the thirdand third to last can be reduced to λN + 9, and so on, so that the squares canthemselves be covered by these forms λN + 1 , λN + 4 , λN + 9 etc. , the number of which is ( N − λN + a, λN + b, λN + c, λN + d etc. , so that the letters a, b, c, d etc. would denote either the squares 1 , , ,
16 etc.themselves, or, if they exceed the number N , the residues left from division.Indeed let the other forms, the number of which will also be ( N − λN + α, λN + β, λN + γ, λN + δ etc. , which we will call forms of the second class. Let the following three propertiesabout these pair of classes be noted, which indeed can be easily demonstrated.I. Products of two numbers from the first class are again contained in thefirst class, namely the form λN + ab which occurs in the first class; for if ab N , then the residue resulting from division by N is to beunderstood as taken in its place.II. Numbers of the first class a, b, c, d etc. multiplied by any number of thesecond class α, β, γ, δ etc. will end up in the second class.III. Finally, the product of two numbers from the second class, such as αβ ,will be transferred to the first class.With these established I will demonstrate: If three squares could not begiven whose sum were divisible by N , then a great absurdity will follow fromthis. For let, let us concede for the moment the contrary position that threesquares cannot be given whose sum is divisible by N ; much less therefore couldtwo such squares be given. Then it will follow at once that the form λN − a ,or what reduces to the same, λN + ( N − a ), will not appear in the first class;for given a square of the form λN − a , a square of the form λN + a would yielda sum divisible by N , contrary to the hypothesis. Therefore, so that the form λN − a is contained in the latter class it is necessary that the α, β, γ, δ etc. arecomprised the numbers − , − , − f be any number of the form class,so that a square of the form λN + f are given; if squares of the form λ + 1 areadded to this, λN + f + 1 will be a sum of two squares. Now if a square of theform λN − f − N ; since this is false, the form λN − f − − − f − f + 1 occurs in thefirst class. It can be shown in a similar way that these numbers also must occurin the first class f + 2 , f + 3 , f + 4 etc.;whence taking f = 1, clearly all the forms λN + 1 , λN + 2 , λN + 3 etc.must occur in the first class, and none at all remain for the latter class. On theother hand, we have seen by the same reasoning that the numbers − , − f − , − f − N . Thus there are giventhree, and also four, squares, whose sum will be divisible by N . Corollary
From this theorem in conjunction with the preceding, it follows clearly thatall prime numbers whatsoever are sums of four or fewer squares. And since the14roduct of two or more of these numbers also have this same property, it hasbeen most completely shown that all numbers whatsoever are the sum of foursquares or even fewer.
Scholion
In place of this proposition, the Celebrated Lagrange gave to the public atheorem holding more widely and supported it by an ingenious demonstrationwhich however was abstruse and hard to understand, that could only be un-derstood with the greatest attention. He showed namely that given any primenumber A , two squares pp and qq can always be given so that the formula pp − Bqq − C is divisible by the same prime number A , whatever numbers aretaken for the letters B and C , providing that they are prime with respect to A .I will therefore adjoin here the same theorem extended somewhat more widely,with a much easier and straightforward demonstration. Theorem 6
11. Given any prime number N , three squares xx, yy and zz prime to it canalways be exhibited so that the formula λxx + µyy + νzz becomes divisible by this prime number N , providing these coefficients λ, µ and ν are prime to N , that is, none of them vanish and none of them can be madeequal either to N itself or any multiple of N . Demonstration
Let the letters a, b, c, d etc.denote all the residues which remain from dividing squares by the given primenumber N , which we previously called the first class, whose multitude is ( N − , , ,
16 etc. less than N occur,together with the residues which are left when the larger ones are divided by N . Indeed the numbers a, b, c, d etc. added to some multiple of N shall refer tothis class. On the other hand, all the remaining numbers less than N , whosetotal is also ( N − non-residues , have been givenas the latter class, and designated by the Greek letters α, β, γ, δ etc.Concerning these two types of numbers, we have already noted above that theproduct of two residues or members of the first class again falls in this class,15or example ab, ac, bc etc., reducing them by division to be less than N , andthe product of a residue and a non-residue will appear in the latter class ofnon-residues, and finally the product of two members of the non-residues willagain be a residue. With this noted, we prepare our demonstration so that wewould find a great absurdity to follow if no formula λxx + µyy + νzz could begiven that is divisible by N . The demonstration will proceed in the followingway.I. Since all squares are equal to some residue a or b or c added to a particularmultiple of the number N , for the formula λxx + µyy + νzz were to be divisibleby the number N , because xx = ζN + a , yy = ηN + b and zz = ϑN + c , itis certainly equivalent that the formula λa + µb + νc be divisible by N . If ourtheorem were false, there should be no way to make the formula λa + µb + νc divisible by N .II. Then since no formula of this type could be given that is divisible by N , still less could it be = 0, and thus this equation λa = − µb − νc will beimpossible, and equally such an equation λa = ( ζN − µ ) b + ( ηN − ν ) c. Truly, because λ, µ and ν are prime to N , the coefficients ζ and η can alwaysbe chosen so that the formulas ζN − µ and ηN − ν become divisible by λ . Letus therefore put ζN − µ = λm and ηN − ν = λn and the equation a = mb + nc will be impossible too.III. Therefore, since the formula mb + nc cannot be equal to a , and hencecannot appear in the class of residues (for admitting the contrary will negateour theorem), it necessarily appears in the other class of non-residues; there atonce (because c can denote unity) mb + n will occur, and hence all the formulas ma + n, mb + n, mc + n, md + n etc.;since all these numbers are mutually distinct and there are ( N −
1) in total,they completely exhaust the class of non-residues, of course dividing them by N to make them below N .IV. Indeed the products of all these numbers with any number of the firstclass, such as d , will also occur in this class, which will therefore be mad + nd, mbd + nd, mcd + nd etc.16ndeed, the products ab, bd, cd etc. fall in the first class and appear among thenumbers a, b, c, d etc.; and thus all the formulas ma + nd, mb + nd, mc + nd etc. , will occur in the latter class among the non-residues, which each exceed thepreceding by the quantity n ( d − For the sake of brevity let us put thisdifference = ω , which will be prime to this divisor N as long as d is not assumedto be unity, for d − < N and too the number n is prime to N .V. Thus if a number α is contained in the class of non-residues, then simulta-neously α + ω will also occur, and for the same reason this number again incre-mented by ω , namely α +2 ω , and for the same reason the numbers α +3 ω, α +4 ω etc. also occur here. Therefore all the terms of this arithmetic progression α, α + ω, α + 2 ω, α + 3 ω etc. , divided of course by N to remain below N , will occur among the non-residues.VI. Since the difference of this progression is ω , namely a number prime to N , in this progression there will not only be a term divisible by N , but willeven yield all the numbers 1 , , , N .Thus it follows from the contrary hypothesis that all the numbers whatsoever1 , , , λxx + µyy + νzz, can be given which are divisible by N . Therefore indeed such numbers can begiven; and this is that which we set out to show. Corollary 1
Not only will always be possible to find three squares xx, yy and zz of thistype, but also one of them, say zz , is our choice, providing it is not divisible by N . Thus if f denotes any number we please which is not divisible by N , twosquares xx and yy can always be assigned so that the formula λxx + µyy + νf f becomes divisible by N . For demonstrating this, if z is any umber, a number v can always be given so that the product vz divided by N leaves the given residue Translator: Since x xd is a permutation of the residues, mx + nd mxd + nd is apermutation of the non-residues. Translator: That is, the terms ma + nd, mb + nd, mc + nd etc. each exceed the corre-sponding terms ma + n, mb + n, mc + n etc. by n ( d − . For let vz = ϑN + f and our formula multiplied by vv , which certainly willstill be divisible by N , would become λvvxx + µvvyy + ν ( ϑϑN N + 2 ϑN f + f f ) , where, because the term ϑϑN N + 2 ϑN f is itself divisible by N , the remainingform λvvxx + µvvyy + νf f will be divisible by N . Corollary 2
Whatever the numbers λ, µ, ν are, unity or another number number canalways be assumed for one of them. For since by multiplying by ϑ the formula ϑλxx + ϑµyy + ϑνzz will admit division by N , in place of ϑ any such number can be chosen so thatthe product ϑλ leaves unity when divided by N ; for then the formula xx + ϑµyy + ϑνzz will even now be divisible by N . Furthermore, here we can write the residuesarising from division by N in place of ϑµ and ϑν , in which way we arrive at thesame formula which the Celebrated Lagrange considered. Scholion
Thus behold that we have completed an unconditional demonstration of thismost notable theorem for all numbers, that all numbers whatsoever are the sumof four or fewer squares, which indeed Fermat previously professed to have found,but which has perished most sadly through the passage of the years. There cancertainly be no doubt that the demonstration of Fermat was much simpler andmore general than the one which now at last comes to light. What makes itlikely that his demonstration followed different lines is that he demonstratedfrom the same source that all numbers are the sum of three triangular numbersor fewer, then too sums of five pentagonal numbers or fewer, and too sums of sixhexagonal numbers and so on, and this generality is altogether missing from ourconclusion. And we are even still ignorant of a demonstration that any numberis a sum of three triangular numbers or fewer. In the meanwhile however itis appropriate to observe about this theorem that it is only true for integralnumbers, unlike the other which we have demonstrated holds even for fractionalnumbers; for all the fractions , , , , etc. do not allow themselves to be Translator: Euler showed in Theorem 20, §
97 of E242,
Demonstratio theorematis Fer-matiani omnem numerum sive integrum sive fractum esse summam quatuor pauciorumvequadratorum , that every rational number is a sum of four squares of rational numbers. x, y, z such that12 = xx + x yy + y zz + z xx + x + yy + y + zz + z is impossible for whatever fractional numbers are taken for x, y, zx, y, z