Trisha Shetty (Editor)

Sum of squares function

Updated on
Edit
Like
Comment
Share on FacebookTweet on TwitterShare on LinkedInShare on Reddit

The sum of squares function is an arithmetic function that gives the number of representations for a given positive integer n as the sum of k squares, where representations that differ only in the order of the summands or in the signs of the square roots are counted as different, and is denoted by rk(n).

Contents

Definition

The function is defined as

r k ( n ) = | { ( a 1 , a 2 , , a k ) Z k   :   n = a 1 2 + a 2 2 + + a k 2 } |

where |.| denotes the cardinality of the set. In other words, rk(n) is the number of ways n can be written as a sum of k squares.

Particular cases

The number of ways to write a natural number as sum of two squares is given by r2(n). It is given explicitly by

r 2 ( n ) = 4 ( d 1 ( n ) d 3 ( n ) )

where d1(n) is the number of divisors of n which are congruent with 1 modulo 4 and d3(n) is the number of divisors of n which are congruent with 3 modulo 4. Using sums, the expression can be written as:

r 2 ( n ) = 4 d n d 1 , 3 ( mod 4 ) ( 1 ) ( d 1 ) / 2

The number of ways to represent 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 d n ; 4 d d .

Jacobi also found an explicit formula for the case k=8:

r 8 ( n ) = 16 d n ( 1 ) n + d d 3 .

The generating series that gives the coefficients of the general form is based in terms of Jacobi theta function:

ϑ ( 0 ; q ) k = ϑ 3 k ( q ) = n = 0 r k ( n ) q n

where

ϑ ( 0 ; q ) = n = q n 2

References

Sum of squares function Wikipedia