Sum of squares function
{{Short description|Number-theoretical function}}
In number theory, the sum of squares function is an arithmetic function that gives the number of representations for a given positive integer {{math|n}} as the sum of {{math|k}} squares, where representations that differ only in the order of the summands or in the signs of the numbers being squared are counted as different. It is denoted by {{math|rk(n)}}.
Definition
The function is defined as
:
where denotes the cardinality of a set. In other words, {{math|rk(n)}} is the number of ways {{math|n}} can be written as a sum of {{math|k}} squares.
For example, since where each sum has two sign combinations, and also since with four sign combinations. On the other hand, because there is no way to represent 3 as a sum of two squares.
Formulae
= ''k'' = 2 =
[[File:Sum_of_two_squares_theorem.svg|thumb|upright=1.25|Integers satisfying the sum of two squares theorem are squares of possible distances between integer lattice points; values up to 100 are shown, with
valign="top"|• | Squares (and thus integer distances) in red |
valign="top"|• | Non-unique representations (up to rotation and reflection) bolded |
{{main|Sum of two squares theorem#Jacobi's two-square theorem}}
The number of ways to write a natural number as sum of two squares is given by {{math|r2(n)}}. It is given explicitly by
:
where {{math|d1(n)}} is the number of divisors of {{math|n}} which are congruent to 1 modulo 4 and {{math|d3(n)}} is the number of divisors of {{math|n}} which are congruent to 3 modulo 4. Using sums, the expression can be written as:
:
The prime factorization , where are the prime factors of the form and are the prime factors of the form gives another formula
:, if all exponents are even. If one or more are odd, then .
= ''k'' = 3 =
{{See also|Legendre's three-square theorem}}
Gauss proved that for a squarefree number {{math|n > 4}},
:
24 h(-n), & \text{if } n\equiv 3\pmod{8}, \\
0 & \text{if } n\equiv 7\pmod{8}, \\
12 h(-4n) & \text{otherwise},
\end{cases}
where {{math|h(m)}} denotes the class number of an integer {{math|m}}.
There exist extensions of Gauss' formula to arbitrary integer {{math|n}}.{{cite journal |author=P. T. Bateman |title=On the Representation of a Number as the Sum of Three Squares |journal=Trans. Amer. Math. Soc. |volume=71 |year=1951 |pages=70–101 |doi=10.1090/S0002-9947-1951-0042438-4 |url=https://www.ams.org/journals/tran/1951-071-01/S0002-9947-1951-0042438-4/S0002-9947-1951-0042438-4.pdf}}{{cite journal |author1=S. Bhargava |author2= Chandrashekar Adiga | author3 = D. D. Somashekara |title=Three-Square Theorem as an Application of Andrews' Identity |journal=Fibonacci Quart |year=1993 |volume=31 |number=2 |pages=129–133 |doi= 10.1080/00150517.1993.12429300 |url=https://www.fq.math.ca/Scanned/31-2/bhargava.pdf}}
= ''k'' = 4 =
{{main|Jacobi's four-square theorem}}
The number of ways to represent {{math|n}} as the sum of four squares was due to Carl Gustav Jakob Jacobi and it is eight times the sum of all its divisors which are not divisible by 4, i.e.
:
Representing {{math|n {{=}} 2km}}, where m is an odd integer, one can express in terms of the divisor function as follows:
:
= ''k'' = 6 =
The number of ways to represent {{math|n}} as the sum of six squares is given by
:
where is the Kronecker symbol.{{cite book |last=Cohen |first=H. |author-link=Henri Cohen (number theorist) |title=Number Theory Volume I: Tools and Diophantine Equations |chapter=5.4 Consequences of the Hasse–Minkowski Theorem |year=2007 |publisher=Springer |isbn=978-0-387-49922-2}}
= ''k'' = 8 =
Jacobi also found an explicit formula for the case {{math|1=k = 8}}:
:
Generating function
The generating function of the sequence for fixed {{math|k}} can be expressed in terms of the Jacobi theta function:{{cite book |last1=Milne |first1=Stephen C. | title = Infinite Families of Exact Sums of Squares Formulas, Jacobi Elliptic Functions, Continued Fractions, and Schur Functions | publisher = Springer Science & Business Media | chapter=Introduction | year = 2002 | isbn=1402004915 |pages=9}}
:
where
:
Numerical values
The first 30 values for are listed in the table below:
class="wikitable" style="text-align:right;"
! n !! = !! r1(n)!! r2(n)!! r3(n)!! r4(n)!! r5(n)!! r6(n)!! r7(n)!! r8(n) | |||||||||
0 | style='text-align:center;'| 0 | 1 | 1 | 1 | 1 | 1 | 1 | 1 | 1 |
1 | style='text-align:center;'| 1 | 2 | 4 | 6 | 8 | 10 | 12 | 14 | 16 |
style="background-color:#ddeeff;"
| 2 | style='text-align:center;'| 2 | 0 | 4 | 12 | 24 | 40 | 60 | 84 | 112 |
style="background-color:#ddeeff;"
| 3 | style='text-align:center;'| 3 | 0 | 0 | 8 | 32 | 80 | 160 | 280 | 448 |
4 | style='text-align:center;'| 22 | 2 | 4 | 6 | 24 | 90 | 252 | 574 | 1136 |
style="background-color:#ddeeff;"
| 5 | style='text-align:center;'| 5 | 0 | 8 | 24 | 48 | 112 | 312 | 840 | 2016 |
6 | style='text-align:center;'| 2×3 | 0 | 0 | 24 | 96 | 240 | 544 | 1288 | 3136 |
style="background-color:#ddeeff;"
| 7 | style='text-align:center;'| 7 | 0 | 0 | 0 | 64 | 320 | 960 | 2368 | 5504 |
8 | style='text-align:center;'| 23 | 0 | 4 | 12 | 24 | 200 | 1020 | 3444 | 9328 |
9 | style='text-align:center;'| 32 | 2 | 4 | 30 | 104 | 250 | 876 | 3542 | 12112 |
10 | style='text-align:center;'| 2×5 | 0 | 8 | 24 | 144 | 560 | 1560 | 4424 | 14112 |
style="background-color:#ddeeff;"
| 11 | style='text-align:center;'| 11 | 0 | 0 | 24 | 96 | 560 | 2400 | 7560 | 21312 |
12 | style='text-align:center;'| 22×3 | 0 | 0 | 8 | 96 | 400 | 2080 | 9240 | 31808 |
style="background-color:#ddeeff;"
| 13 | style='text-align:center;'| 13 | 0 | 8 | 24 | 112 | 560 | 2040 | 8456 | 35168 |
14 | style='text-align:center;'| 2×7 | 0 | 0 | 48 | 192 | 800 | 3264 | 11088 | 38528 |
15 | style='text-align:center;'| 3×5 | 0 | 0 | 0 | 192 | 960 | 4160 | 16576 | 56448 |
16 | style='text-align:center;'| 24 | 2 | 4 | 6 | 24 | 730 | 4092 | 18494 | 74864 |
style="background-color:#ddeeff;"
| 17 | style='text-align:center;'| 17 | 0 | 8 | 48 | 144 | 480 | 3480 | 17808 | 78624 |
18 | style='text-align:center;'| 2×32 | 0 | 4 | 36 | 312 | 1240 | 4380 | 19740 | 84784 |
style="background-color:#ddeeff;"
| 19 | style='text-align:center;'| 19 | 0 | 0 | 24 | 160 | 1520 | 7200 | 27720 | 109760 |
20 | style='text-align:center;'| 22×5 | 0 | 8 | 24 | 144 | 752 | 6552 | 34440 | 143136 |
21 | style='text-align:center;'| 3×7 | 0 | 0 | 48 | 256 | 1120 | 4608 | 29456 | 154112 |
22 | style='text-align:center;'| 2×11 | 0 | 0 | 24 | 288 | 1840 | 8160 | 31304 | 149184 |
style="background-color:#ddeeff;"
| 23 | style='text-align:center;'| 23 | 0 | 0 | 0 | 192 | 1600 | 10560 | 49728 | 194688 |
24 | style='text-align:center;'| 23×3 | 0 | 0 | 24 | 96 | 1200 | 8224 | 52808 | 261184 |
25 | style='text-align:center;'| 52 | 2 | 12 | 30 | 248 | 1210 | 7812 | 43414 | 252016 |
26 | style='text-align:center;'| 2×13 | 0 | 8 | 72 | 336 | 2000 | 10200 | 52248 | 246176 |
27 | style='text-align:center;'| 33 | 0 | 0 | 32 | 320 | 2240 | 13120 | 68320 | 327040 |
28 | style='text-align:center;'| 22×7 | 0 | 0 | 0 | 192 | 1600 | 12480 | 74048 | 390784 |
style="background-color:#ddeeff;"
| 29 | style='text-align:center;'| 29 | 0 | 8 | 72 | 240 | 1680 | 10104 | 68376 | 390240 |
30 | style='text-align:center;'| 2×3×5 | 0 | 0 | 48 | 576 | 2720 | 14144 | 71120 | 395136 |
See also
References
{{reflist}}
Further reading
{{Cite book |last=Grosswald |first=Emil |author-link=Emil Grosswald |title=Representations of integers as sums of squares |publisher=Springer-Verlag |year=1985 |isbn=0387961267}}
External links
- {{MathWorld|id=SumofSquaresFunction|title=Sum of Squares Function}}
- {{cite OEIS|A122141|number of ways of writing n as a sum of d squares}}
- {{cite OEIS|A004018|Theta series of square lattice, r_2(n)}}