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

:r_k(n) = |\{(a_1, a_2, \ldots, a_k) \in \mathbb{Z}^k \ : \ n = a_1^2 + a_2^2 + \cdots + a_k^2\}|

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, r_2(1) = 4 since 1 = 0^2 + (\pm 1)^2 = (\pm 1)^2 + 0^2 where each sum has two sign combinations, and also r_2(2) = 4 since 2 = (\pm 1)^2 + (\pm 1)^2 with four sign combinations. On the other hand, r_2(3) = 0 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

:r_2(n) = 4(d_1(n)-d_3(n))

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:

:r_2(n) = 4\sum_{d \mid n \atop d\,\equiv\,1,3 \pmod 4}(-1)^{(d-1)/2}

The prime factorization n = 2^g p_1^{f_1}p_2^{f_2}\cdots q_1^{h_1}q_2^{h_2}\cdots , where p_i are the prime factors of the form p_i \equiv 1\pmod 4, and q_i are the prime factors of the form q_i \equiv 3\pmod 4 gives another formula

:r_2(n) = 4 (f_1 +1)(f_2+1)\cdots , if all exponents h_1, h_2, \cdots are even. If one or more h_i are odd, then r_2(n) = 0.

= ''k'' = 3 =

{{See also|Legendre's three-square theorem}}

Gauss proved that for a squarefree number {{math|n > 4}},

:r_3(n) = \begin{cases}

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.

:r_4(n)=8\sum_{d\,\mid\,n,\ 4\,\nmid\,d}d.

Representing {{math|n {{=}} 2km}}, where m is an odd integer, one can express r_4(n) in terms of the divisor function as follows:

:r_4(n) = 8\sigma(2^{\min\{k,1\}}m).

= ''k'' = 6 =

The number of ways to represent {{math|n}} as the sum of six squares is given by

:r_6(n) = 4\sum_{d\mid n} d^2\big( 4\left(\tfrac{-4}{n/d}\right) - \left(\tfrac{-4}{d}\right)\big),

where \left(\tfrac{\cdot}{\cdot}\right) 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}}:

:r_8(n) = 16\sum_{d\,\mid\,n}(-1)^{n+d}d^3.

Generating function

The generating function of the sequence r_k(n) 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}}

:\vartheta(0;q)^k = \vartheta_3^k(q) = \sum_{n=0}^{\infty}r_k(n)q^n,

where

:\vartheta(0;q) = \sum_{n=-\infty}^{\infty}q^{n^2} = 1 + 2q + 2q^4 + 2q^9 + 2q^{16} + \cdots.

Numerical values

The first 30 values for r_k(n), \; k=1, \dots, 8 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)

0style='text-align:center;'| 011111111
1style='text-align:center;'| 1246810121416
style="background-color:#ddeeff;"

| 2

style='text-align:center;'| 2041224406084112
style="background-color:#ddeeff;"

| 3

style='text-align:center;'| 30083280160280448
4style='text-align:center;'| 2224624902525741136
style="background-color:#ddeeff;"

| 5

style='text-align:center;'| 50824481123128402016
6style='text-align:center;'| 2×300249624054412883136
style="background-color:#ddeeff;"

| 7

style='text-align:center;'| 70006432096023685504
8style='text-align:center;'| 23041224200102034449328
9style='text-align:center;'| 322430104250876354212112
10style='text-align:center;'| 2×508241445601560442414112
style="background-color:#ddeeff;"

| 11

style='text-align:center;'| 110024965602400756021312
12style='text-align:center;'| 22×3008964002080924031808
style="background-color:#ddeeff;"

| 13

style='text-align:center;'| 1308241125602040845635168
14style='text-align:center;'| 2×7004819280032641108838528
15style='text-align:center;'| 3×500019296041601657656448
16style='text-align:center;'| 242462473040921849474864
style="background-color:#ddeeff;"

| 17

style='text-align:center;'| 17084814448034801780878624
18style='text-align:center;'| 2×320436312124043801974084784
style="background-color:#ddeeff;"

| 19

style='text-align:center;'| 1900241601520720027720109760
20style='text-align:center;'| 22×50824144752655234440143136
21style='text-align:center;'| 3×700482561120460829456154112
22style='text-align:center;'| 2×1100242881840816031304149184
style="background-color:#ddeeff;"

| 23

style='text-align:center;'| 2300019216001056049728194688
24style='text-align:center;'| 23×30024961200822452808261184
25style='text-align:center;'| 52212302481210781243414252016
26style='text-align:center;'| 2×13087233620001020052248246176
27style='text-align:center;'| 33003232022401312068320327040
28style='text-align:center;'| 22×700019216001248074048390784
style="background-color:#ddeeff;"

| 29

style='text-align:center;'| 29087224016801010468376390240
30style='text-align:center;'| 2×3×5004857627201414471120395136

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}}