This site is supported by donations to The OEIS Foundation.
Sums of squares
This article is under construction.
Please do not rely on any information it contains.
All positive integers can be expressed as sums of squares. Some can be expressed as the sum of two or three squares, some can be expressed as the sum of a million squares. And some can be expressed expressed as sums of squares in multiple ways. For example, 338350 is the sum of the first hundred nonzero squares. It can also be represented as 580^{2} + 43^{2} + 10^{2} + 1^{2}.
Since the square of a negative number is a positive number, we will not bother to distinguish between the squares of negative integers and the squares of positive integers in this article. However, we will distinguish between sums of squares that may include instances of 0^{2} and those that must consist solely of the squares of nonzero integers; the latter will be referred to as "nonzero squares" here.
Among numbers that can be represented as the sum of a given number of squares, we may distinguish between those that can be represented with fewer squares and those that can't. For example, 25 = 4^{2} + 3^{2}, but also 5^{2}, whereas 29 = 5^{2} + 2^{2} but we can't use (that is inelegant at best and cheating at worst).
Numbers that can be represented with squares | Numbers that can't be represented with fewer than squares | |||
1 | 1, 4, 9, 16, 25, 36, 49, 64, 81, 100, 121, ... | A000290 | ||
2 | 2, 5, 8, 10, 13, 17, 18, 20, 25, 26, 29, 32, ... | A000404 | 2, 5, 8, 10, 13, 17, 18, 20, 26, 29, 32, 34, ... | A000415 |
3 | 3, 6, 9, 11, 12, 14, 17, 18, 19, 21, 24, 26, 27, 30, ... | A000408 | 3, 6, 11, 12, 14, 19, 21, 22, 24, 27, 30, 33, 35, 38, ... | A000419 |
4 | 4, 7, 10, 12, 13, 15, 16, 18, 19, 20, 21, 22, 23, 25, ... | A000414 | 7, 15, 23, 31, 39, 47, 55, 63, 71, 79, 87, 95, 103, ... | A004771 |
5 | 5, 8, 11, 13, 14, 16, 17, 19, 20, 21, 22, 23, 24, 25, ... | A047700 | None | |
6 | 6, 9, 12, 14, 15, 16, 17, 20, 21, 22, ... | |||
7 | 7, 10, 13, 15, 16, 18, 21, 22, ... |
Sums of four squares
The answer to Waring's problem for squares is that all integers have at least one representation as the sum of at most four squares.
- Theorem SQS4. Every positive integer can be expressed as the sum of at most four nonzero squares. Or we can say that all positive integers are the sum of four squares, some, but not all, of which may be zero: that is, , with .
- Proof. PROOF GOES HERE. ENDOFPROOFMARK
When , the number requires four nonzero squares. Obviously prime numbers require at least two nonzero squares for their Waring representation. See Theorem P2SQ in the Gaussian integers article for a result regarding which primes can be expressed as the sum of two squares.
- Corollary to Theorem SQS4. If is the sum of four equal nonzero squares, then it has at least two representations as sum of squares, at least one of which includes zeroes. The stricture may have given the impression that the theorem does not cover the sums of equal squares, but this would be a false impression, as a little rewriting will show. If , then (or , etc.). We can rewrite . Reassigning and 'resetting' , and to 0 gives us a representation of satisfying the inequality given in the theorem.
Sums of five squares
With just a few exceptions (see A047701), all positive integers can be expressed as the sum of five nonzero squares. For example, 255 = 9^{2} + 8^{2} + 7^{2} + 6^{2} + 5^{2}.
- Theorem SQS5. Every integer can be expressed as the sum of five nonzero squares.^{[1]}
- Proof. The cases are examined one by one in the table below, demonstrating that each of them has at least one representation as the sum of five nonzero squares. For , we will need the 4-square representation, which may include zeroes, which Theorem SQS4 tells us exists for all . What is special about 169 is not that it is a square, but that it can also be represented as the sum of five, four, three or two squares. Solve the equation observing the stricture . If , then . If , then . If , then . And if only , then we have . □ ^{[2]}
Of course some integers have more than one representation as a sum of five nonzero squares, and the proof of Theorem SQS5 might not always give us the most "interesting" representation. Returning to our example of 255, the method outlined in the proof would give us 255 = (12^{2} + 5^{2}) + (9^{2} + 2^{2} + 1^{2}).
34 | 4^{2} + 3^{2} + 2^{2} + 2^{2} + 1^{2} | 35 | 5^{2} + 2^{2} + 2^{2} + 1^{2} + 1^{2} | 36 | 4^{2} + 3^{2} + 3^{2} + 1^{2} + 1^{2} |
37 | 5^{2} + 3^{2} + 1^{2} + 1^{2} + 1^{2} | 38 | 4^{2} + 4^{2} + 2^{2} + 1^{2} + 1^{2} | 39 | 4^{2} + 3^{2} + 3^{2} + 2^{2} + 1^{2} |
40 | 6^{2} + 1^{2} + 1^{2} + 1^{2} + 1^{2} | 41 | 5^{2} + 3^{2} + 2^{2} + 1^{2} + 1^{2} | 42 | 4^{2} + 3^{2} + 3^{2} + 2^{2} + 2^{2} |
43 | 5^{2} + 3^{2} + 2^{2} + 2^{2} + 1^{2} | 44 | 5^{2} + 4^{2} + 1^{2} + 1^{2} + 1^{2} | 45 | 5^{2} + 3^{2} + 3^{2} + 1^{2} + 1^{2} |
46 | 4^{2} + 4^{2} + 3^{2} + 2^{2} + 1^{2} | 47 | 5^{2} + 4^{2} + 2^{2} + 1^{2} + 1^{2} | 48 | 5^{2} + 3^{2} + 3^{2} + 2^{2} + 1^{2} |
49 | 6^{2} + 2^{2} + 2^{2} + 2^{2} + 1^{2} | 50 | 5^{2} + 4^{2} + 2^{2} + 2^{2} + 1^{2} | 51 | 6^{2} + 3^{2} + 2^{2} + 1^{2} + 1^{2} |
52 | 5^{2} + 4^{2} + 3^{2} + 1^{2} + 1^{2} | 53 | 4^{2} + 4^{2} + 4^{2} + 2^{2} + 1^{2} | 54 | 6^{2} + 3^{2} + 2^{2} + 2^{2} + 1^{2} |
55 | 5^{2} + 4^{2} + 3^{2} + 2^{2} + 1^{2} | 56 | 5^{2} + 5^{2} + 2^{2} + 1^{2} + 1^{2} | 57 | 6^{2} + 3^{2} + 2^{2} + 2^{2} + 2^{2} |
58 | 6^{2} + 4^{2} + 2^{2} + 1^{2} + 1^{2} | 59 | 6^{2} + 3^{2} + 3^{2} + 2^{2} + 1^{2} | 60 | 5^{2} + 4^{2} + 3^{2} + 3^{2} + 1^{2} |
61 | 6^{2} + 4^{2} + 2^{2} + 2^{2} + 1^{2} | 62 | 5^{2} + 4^{2} + 4^{2} + 2^{2} + 1^{2} | 63 | 6^{2} + 4^{2} + 3^{2} + 1^{2} + 1^{2} |
64 | 7^{2} + 3^{2} + 2^{2} + 1^{2} + 1^{2} | 65 | 4^{2} + 4^{2} + 4^{2} + 4^{2} + 1^{2} | 66 | 6^{2} + 4^{2} + 3^{2} + 2^{2} + 1^{2} |
67 | 6^{2} + 5^{2} + 2^{2} + 1^{2} + 1^{2} | 68 | 5^{2} + 5^{2} + 4^{2} + 1^{2} + 1^{2} | 69 | 7^{2} + 3^{2} + 3^{2} + 1^{2} + 1^{2} |
70 | 6^{2} + 5^{2} + 2^{2} + 2^{2} + 1^{2} | 71 | 7^{2} + 4^{2} + 2^{2} + 1^{2} + 1^{2} | 72 | 6^{2} + 5^{2} + 3^{2} + 1^{2} + 1^{2} |
73 | 6^{2} + 5^{2} + 2^{2} + 2^{2} + 2^{2} | 74 | 7^{2} + 4^{2} + 2^{2} + 2^{2} + 1^{2} | 75 | 6^{2} + 5^{2} + 3^{2} + 2^{2} + 1^{2} |
76 | 7^{2} + 4^{2} + 3^{2} + 1^{2} + 1^{2} | 77 | 7^{2} + 5^{2} + 1^{2} + 1^{2} + 1^{2} | 78 | 6^{2} + 4^{2} + 4^{2} + 3^{2} + 1^{2} |
79 | 7^{2} + 4^{2} + 3^{2} + 2^{2} + 1^{2} | 80 | 7^{2} + 5^{2} + 2^{2} + 1^{2} + 1^{2} | 81 | 6^{2} + 6^{2} + 2^{2} + 2^{2} + 1^{2} |
82 | 6^{2} + 5^{2} + 4^{2} + 2^{2} + 1^{2} | 83 | 7^{2} + 5^{2} + 2^{2} + 2^{2} + 1^{2} | 84 | 7^{2} + 4^{2} + 3^{2} + 3^{2} + 1^{2} |
85 | 7^{2} + 5^{2} + 3^{2} + 1^{2} + 1^{2} | 86 | 8^{2} + 4^{2} + 2^{2} + 1^{2} + 1^{2} | 87 | 6^{2} + 5^{2} + 4^{2} + 3^{2} + 1^{2} |
88 | 7^{2} + 5^{2} + 3^{2} + 2^{2} + 1^{2} | 89 | 8^{2} + 4^{2} + 2^{2} + 2^{2} + 1^{2} | 90 | 6^{2} + 6^{2} + 4^{2} + 1^{2} + 1^{2} |
91 | 7^{2} + 6^{2} + 2^{2} + 1^{2} + 1^{2} | 92 | 7^{2} + 5^{2} + 4^{2} + 1^{2} + 1^{2} | 93 | 7^{2} + 5^{2} + 3^{2} + 3^{2} + 1^{2} |
94 | 8^{2} + 4^{2} + 3^{2} + 2^{2} + 1^{2} | 95 | 7^{2} + 5^{2} + 4^{2} + 2^{2} + 1^{2} | 96 | 9^{2} + 3^{2} + 2^{2} + 1^{2} + 1^{2} |
97 | 7^{2} + 6^{2} + 2^{2} + 2^{2} + 2^{2} | 98 | 8^{2} + 5^{2} + 2^{2} + 2^{2} + 1^{2} | 99 | 7^{2} + 6^{2} + 3^{2} + 2^{2} + 1^{2} |
100 | 7^{2} + 5^{2} + 4^{2} + 3^{2} + 1^{2} | 101 | 8^{2} + 4^{2} + 4^{2} + 2^{2} + 1^{2} | 102 | 6^{2} + 6^{2} + 5^{2} + 2^{2} + 1^{2} |
103 | 8^{2} + 5^{2} + 3^{2} + 2^{2} + 1^{2} | 104 | 9^{2} + 3^{2} + 3^{2} + 2^{2} + 1^{2} | 105 | 6^{2} + 6^{2} + 4^{2} + 4^{2} + 1^{2} |
106 | 7^{2} + 6^{2} + 4^{2} + 2^{2} + 1^{2} | 107 | 6^{2} + 6^{2} + 5^{2} + 3^{2} + 1^{2} | 108 | 9^{2} + 4^{2} + 3^{2} + 1^{2} + 1^{2} |
109 | 8^{2} + 6^{2} + 2^{2} + 2^{2} + 1^{2} | 110 | 8^{2} + 5^{2} + 4^{2} + 2^{2} + 1^{2} | 111 | 9^{2} + 4^{2} + 3^{2} + 2^{2} + 1^{2} |
112 | 9^{2} + 5^{2} + 2^{2} + 1^{2} + 1^{2} | 113 | 10^{2} + 2^{2} + 2^{2} + 2^{2} + 1^{2} | 114 | 8^{2} + 6^{2} + 3^{2} + 2^{2} + 1^{2} |
115 | 7^{2} + 6^{2} + 5^{2} + 2^{2} + 1^{2} | 116 | 9^{2} + 4^{2} + 3^{2} + 3^{2} + 1^{2} | 117 | 9^{2} + 5^{2} + 3^{2} + 1^{2} + 1^{2} |
118 | 8^{2} + 6^{2} + 4^{2} + 1^{2} + 1^{2} | 119 | 8^{2} + 7^{2} + 2^{2} + 1^{2} + 1^{2} | 120 | 9^{2} + 5^{2} + 3^{2} + 2^{2} + 1^{2} |
121 | 8^{2} + 6^{2} + 4^{2} + 2^{2} + 1^{2} | 122 | 10^{2} + 4^{2} + 2^{2} + 1^{2} + 1^{2} | 123 | 9^{2} + 6^{2} + 2^{2} + 1^{2} + 1^{2} |
124 | 8^{2} + 7^{2} + 3^{2} + 1^{2} + 1^{2} | 125 | 10^{2} + 4^{2} + 2^{2} + 2^{2} + 1^{2} | 126 | 8^{2} + 6^{2} + 4^{2} + 3^{2} + 1^{2} |
127 | 8^{2} + 7^{2} + 3^{2} + 2^{2} + 1^{2} | 128 | 9^{2} + 6^{2} + 3^{2} + 1^{2} + 1^{2} | 129 | 9^{2} + 6^{2} + 2^{2} + 2^{2} + 2^{2} |
130 | 8^{2} + 6^{2} + 5^{2} + 2^{2} + 1^{2} | 131 | 9^{2} + 6^{2} + 3^{2} + 2^{2} + 1^{2} | 132 | 9^{2} + 5^{2} + 4^{2} + 3^{2} + 1^{2} |
133 | 7^{2} + 7^{2} + 5^{2} + 3^{2} + 1^{2} | 134 | 8^{2} + 7^{2} + 4^{2} + 2^{2} + 1^{2} | 135 | 8^{2} + 6^{2} + 5^{2} + 3^{2} + 1^{2} |
136 | 11^{2} + 3^{2} + 2^{2} + 1^{2} + 1^{2} | 137 | 10^{2} + 4^{2} + 4^{2} + 2^{2} + 1^{2} | 138 | 9^{2} + 6^{2} + 4^{2} + 2^{2} + 1^{2} |
139 | 10^{2} + 5^{2} + 3^{2} + 2^{2} + 1^{2} | 140 | 8^{2} + 7^{2} + 5^{2} + 1^{2} + 1^{2} | 141 | 9^{2} + 7^{2} + 3^{2} + 1^{2} + 1^{2} |
142 | 8^{2} + 6^{2} + 5^{2} + 4^{2} + 1^{2} | 143 | 8^{2} + 7^{2} + 5^{2} + 2^{2} + 1^{2} | 144 | 9^{2} + 7^{2} + 3^{2} + 2^{2} + 1^{2} |
145 | 10^{2} + 6^{2} + 2^{2} + 2^{2} + 1^{2} | 146 | 10^{2} + 5^{2} + 4^{2} + 2^{2} + 1^{2} | 147 | 9^{2} + 6^{2} + 5^{2} + 2^{2} + 1^{2} |
148 | 8^{2} + 7^{2} + 5^{2} + 3^{2} + 1^{2} | 149 | 8^{2} + 8^{2} + 4^{2} + 2^{2} + 1^{2} | 150 | 10^{2} + 6^{2} + 3^{2} + 2^{2} + 1^{2} |
151 | 11^{2} + 4^{2} + 3^{2} + 2^{2} + 1^{2} | 152 | 9^{2} + 6^{2} + 5^{2} + 3^{2} + 1^{2} | 153 | 8^{2} + 6^{2} + 6^{2} + 4^{2} + 1^{2} |
154 | 8^{2} + 7^{2} + 6^{2} + 3^{2} + 1^{2} | 155 | 8^{2} + 7^{2} + 5^{2} + 4^{2} + 1^{2} | 156 | 9^{2} + 7^{2} + 4^{2} + 3^{2} + 1^{2} |
157 | 10^{2} + 6^{2} + 4^{2} + 2^{2} + 1^{2} | 158 | 10^{2} + 7^{2} + 2^{2} + 2^{2} + 1^{2} | 159 | 9^{2} + 8^{2} + 3^{2} + 2^{2} + 1^{2} |
160 | 11^{2} + 5^{2} + 3^{2} + 2^{2} + 1^{2} | 161 | 10^{2} + 7^{2} + 2^{2} + 2^{2} + 2^{2} | 162 | 10^{2} + 6^{2} + 4^{2} + 3^{2} + 1^{2} |
163 | 10^{2} + 7^{2} + 3^{2} + 2^{2} + 1^{2} | 164 | 11^{2} + 5^{2} + 4^{2} + 1^{2} + 1^{2} | 165 | 9^{2} + 7^{2} + 5^{2} + 3^{2} + 1^{2} |
166 | 9^{2} + 8^{2} + 4^{2} + 2^{2} + 1^{2} | 167 | 11^{2} + 5^{2} + 4^{2} + 2^{2} + 1^{2} | 168 | 11^{2} + 6^{2} + 3^{2} + 1^{2} + 1^{2} |
169 | 12^{2} + 4^{2} + 2^{2} + 2^{2} + 1^{2} |
References
- ↑ This is part of Theorem 5.6 in Niven & Zuckerman (1980), on pages 144 and 145. In that book, they also prove that there infinitely many integers which are not the sum of four nonzero squares.
- ↑ This is pretty much the same as the proof given in Niven & Zuckerman (1980), p. 145, but with the statements regarding numbers that are not the sums of four nonzero squares left out.
- Ivan Niven & Herbert S. Zuckerman, An Introduction to the Theory of Numbers, New York: John Wiley (1980).