Lecture 32: Integers as Sums of Squares

Integers as Sums of Squares

Note: the information (except selected portions near the end) comes from our Text by Strayer

Introduction: We began by splitting the students into small groups, and having them explore which integers between 1 and 30 can be expressed as the sum of two squares. We noticed that some numbers require the sum of three or four squares, and possibly more. The main question we posed was, is there a number x so that any integer can be represented as the sum of at most x integers?

6.5 Proposition
Let n1 and n2 be positive integers where n1 = a2 + b2 and n2 = x2 + y2. Then n1n2 can be written as the sum of two squares of integers.
Proof: Notice that this means n1 and n2 are each the sum of two squares. We can use this notation and see that
n1n2 = (a2 + b2)(x2 + y2)
= a2x2 + a2y2 + b2x2 + b2y2
= (a2x2 + b2y2) + (a2y2 + b2x2)
= (a2x2 + 2abxy + b2y2) + (a2y2 - 2abxy + b2x2)
=(ax + by)2 + (ay - bx)2

so that ax+by is one integer and ay-xb is another integer.
Note: You may remember this from the class on Pythagorean Triples.

6.6 Lemma
Let p be prime such that p is congruent to 1 mod 4. Then there exists integers x and y so that
x2 + y2 = kp, with k an integer such that 0 < k < p.
Proof: We have that p is congruent to 1 mod 4, so we then know from our quadratic residue knowledge that (-1/p) = 1.
Then there exists an integer x, with 0 < x < (p-1)/2 such that x2 is congruent to -1 mod p.
Thus we know that p divides x2 + 1, which implies that x2 + 1 = kp, with k being any integer.
Here we observe that y = 1, y2 = 12, which implies that y2 = 1.
Then k > 0,
kp = x2 + y2 < (p/2)2 + 1 < p2, which implies that k < p, and we are done.

6.7 Proposition
Let p be a prime number such that p is NOT congruent to 3 mod 4. Then p can be expressed as the sum of two squares of integers.

We know that p not congruent to 3 mod 4 means that we must have that p is congruent to 1 mod 4 or p is congruent to 2 mod 4.
Thus the prime number 2 is also applicable: 12 + 12 = 2.

6.8 Theorem: Sum of Two Squares
(in the interest of time, we didn't go through this proof in class)
Let n be an integer greater than zero. Then n can be expressed as the sum of two squares of integers if and only if every prime factor of the form p is congruent to 3 modulo 4 is taken to an even power.
Proof:
(->)
Assume p is an odd number in the prime factorization of n such that p2k+1, with k being any integer.
We want to show that p is congruent to 1 mod 4.
We know n is the sum of two squares of integers: n = x2 + y2, with x, y integers.
Set d = (x, y), meaning the greatest common factor of x and y. Then we have x/d = a, and y/d = b, with n/d2 = m. Then we know that a and be are relatively prime and thus
a2 + b2 = m (by prior class notes).
Take pk, where k is the largest integer power of p that still divides d. Thus, m is divisible by p(2i+1)-2k, where we know that (2i+1)-2k is greater than or equal to 1, so we have that m is divisible by p.
Because m is divisible by p, we know that p cannot divide a because a and b are relatively prime.
Since p does not divide a, we have that aj = b mod p. Then,
m = a2 + b2 = a2 + (aj)2 = a2(1 + j2) mod p.
Also, with m being divisible by p, we have
a2(1 + j2) = 0 mod p or p divides a2(1 + j2)
Thus, p divides 1 + j2 (because p does not divide a), which also can be represented as j2 is congruent to -1 mod p. This means that -1 is a quadratic residue mod p (with p being congruent to 1 mod 4).
In conclusion, we see that an odd power of an odd prime factor in the prime factorization of n must be congruent to 1 mod 4, and thus a prime factor congruent to 3 mod 4 must be taken to an even power in the prime factorization.
(<-)
We assume that it is true that every prime factor of the form 3 mod 4 in the prime factorization of n is taken to the even power.
If m is an integer and p1,p2,…,pk are distinct prime numbers of the form 1 mod 4 or equal to 2, then we can say that n = m(p1p2…pk).
Thus m2 can easily be expressed as (m2 + 02), the sum of two squares of integers.

6.9 Proposition
Let m, n be integers equal to or greater than 0. If N = 4m(8n+7), then N is NOT expressible as the sum of three squares of integers.
Example:
1584 = 42(8(12)+3) thus not in the form 4m(8n+7), so it can be expressed as the sum of 3 squares.
960 = 43(8(1)+7). Because it is of the form 4m(8n+7), it cannot be expressed as the sum of 3 squares.

Interesting Note:
For the equation N = 4m(8n+7), the (8n+7) part is equivalent to 7 mod 8. This stems from the fact that every square of a number is either 0,1, or 4 mod 8. Since this holds true for the squares of numbers, no integer congruent to 7 mod 8 can be represented as the sum of three squares. Therefore, we must have some numbers that need to be represented by the sum of four squares.

6.10 Euler's Proposition
Let n1 and n2 be positive integers. If n1 and n2 can each be expressed as the sum of the squares of 4 integers, then n1n2 can be expressed as the sum of squares of 4 integers.
Proof: Let n1 = a2 + b2 + c2 + d2
n2 = w2 + x2 + y2 + z2
Then n1n2 = (a2 + b2 + c2 + d2)(w2 + x2 + y2 + z2)
= (aw + bx + cy + dz)2 + (-ax + bw - cz + dy)2 + (-ay + cw + bz - dx)2
+ (-az + dw - by + cx)2
Which is the sum of 4 integers. I won't waste our time with the algebra that it takes to get to this step, but if you don't believe me, you can expand all of these and see that it is true.
Example: 4 = 12 + 12 + 12 + 12 and 16 = 22 + 22 + 22 + 22
so if we use the formula given in the proof,
64 = (1*2 + 1*2 + 1*2 + 1*2)2 + (-1*2 + 1*2 - 1*2 + 1*2)2
+ (-1*2 + 1*2 + 1*2 - 1*2)2 + (-1*2 + 1*2 - 1*2 + 1*2)2
= (2 + 2 + 2 + 2)2 + 0 + 0 + 0
= 82
= 64

Proposition 6.12
All prime numbers can be expressed as the sum of squares of 4 integers.

Proof: The proof of this is based on a lemma that we skipped in the interest of time… see page 175 if you'd like to read it for yourself.

Examples: 11 = 32 + 12 + 12 + 02
67 = 82 + 12 + 12 + 12
751 = 252 + 112 + 22 + 12

Note: this is important because in this class, we always examine what happens at prime numbers, so we can generalize to what happens to any integer.

6.13 Lagrange's Theorem
All positive integers can be expressed as the sum of squares of 4 integers.
Note: this is the number x we talked about at the beginning of class.
Note 2: this is one of the main theorems of the lesson, but it is very easy to prove because we already have the tools we need.
Proof: If n = 1, then 1 = 12 + 02 + 02 + 02
If n > 1, then by the Fundamental Theorem of Arithmetic, n can be uniquely expressed as the product of primes. By Prop. 6.12, each of these primes can be expressed as the sum of squares of 4 integers. By Euler's Proposition, the product of all these primes can be expressed as the sum of squares of 4 integers.
Examples: 9614 = 842 + 412 + 292 + 62
396900 = 3152 + 3152 + 3152 + 3152

Waring's Problem
As we've now seen, some numbers can be written as the sum of 2 squares. Other numbers must be represented by a minimum of three squares. And other must be represented by a minimum of 4 squares. We know, by Lagrange's theorem, that all numbers can be represented by the sum of 4 squares. This leads to the question of how many cubes are needed to express another number as the sum of cubes. This is referred to as Waring's Problem.
Let k be an integer with k > 0. Does there exist a minimum integer g(k) such that every positive integer is expressible as the sum of at most g(k) kth powers of nonnegative integers?
g(1) = 1
g(2) = 4
What is g(3)? Is there a solution to g(3)? What about g(4)?
When Waring first went about trying to find a solution, he took some arbitrary numbers and subtracted the largest integer xk that could fit under the integer. He continued this until he found an integer xk that would equal his remaining number.

An example of this for k=3.

23 - 23 = 15
15 - 23 = 7
7 - 7(13) = 0

So 23 = 23 + 23 + 7 copies of 13.

Waring figured that for k = 3, g(k) was greater than or equal to 9. He did this for the fourth power as well, and found that g(4) was greater than or equal to 19.

A solution eventually came: The Hilbert-Waring theorem, proved by Hilbert in 1909 showed this:
Let k be an integer with k > 0. Then there exists a minimum integer g(k) such that every positive integer is expressible as the sume of at most g(k) kth powers of nonnegative integers.
The only problem with Hilbert's analysis is that the proof gives no formula for figuring out what g(k) is and there is no mention of a formula existing.

Further analysis of Waring's problem has led to some discoveries of what g(k) could possible be. At this point in time, there is a great deal of numerical evidence to suggest that g(k) = [(3/2)^k] + 2^k - 2, where [()] is the greatest integer. This has proved valid for all k up to 471,600,000

An example of this for g(4): (3/2)4 equals 81/16 which has a greatest integer value of 5. 24 equals 16. So 5 + 16 - 2 = 19, which is the value for g(4).

Unless otherwise stated, the content of this page is licensed under Creative Commons Attribution-ShareAlike 3.0 License