Sum of squares function
   HOME

TheInfoList



OR:

In
number theory Number theory is a branch of pure mathematics devoted primarily to the study of the integers and arithmetic functions. Number theorists study prime numbers as well as the properties of mathematical objects constructed from integers (for example ...
, the sum of squares function is an
arithmetic function In number theory, an arithmetic, arithmetical, or number-theoretic function is generally any function whose domain is the set of positive integers and whose range is a subset of the complex numbers. Hardy & Wright include in their definition th ...
that gives the number of representations for a given positive
integer An integer is the number zero (0), a positive natural number (1, 2, 3, ...), or the negation of a positive natural number (−1, −2, −3, ...). The negations or additive inverses of the positive natural numbers are referred to as negative in ...
as the sum of
squares In geometry, a square is a regular polygon, regular quadrilateral. It has four straight sides of equal length and four equal angles. Squares are special cases of rectangles, which have four equal angles, and of rhombuses, which have four equal si ...
, 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 .


Definition

The function is defined as :r_k(n) = , \, where , \,\ , denotes the
cardinality The thumb is the first digit of the hand, next to the index finger. When a person is standing in the medical anatomical position (where the palm is facing to the front), the thumb is the outermost digit. The Medical Latin English noun for thum ...
of a
set Set, The Set, SET or SETS may refer to: Science, technology, and mathematics Mathematics *Set (mathematics), a collection of elements *Category of sets, the category whose objects and morphisms are sets and total functions, respectively Electro ...
. In other words, is the number of ways can be written as a sum of 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

The number of ways to write a
natural number In mathematics, the natural numbers are the numbers 0, 1, 2, 3, and so on, possibly excluding 0. Some start counting with 0, defining the natural numbers as the non-negative integers , while others start with 1, defining them as the positive in ...
as sum of two squares is given by . It is given explicitly by :r_2(n) = 4(d_1(n)-d_3(n)) where is the number of divisors of which are
congruent Congruence may refer to: Mathematics * Congruence (geometry), being the same size and shape * Congruence or congruence relation, in abstract algebra, an equivalence relation on an algebraic structure that is compatible with the structure * In modu ...
to 1
modulo In computing and mathematics, the modulo operation returns the remainder or signed remainder of a division, after one number is divided by another, the latter being called the '' modulus'' of the operation. Given two positive numbers and , mo ...
4 and is the number of divisors of which are congruent to 3 modulo 4. Using sums, the expression can be written as: :r_2(n) = 4\sum_(-1)^ The prime
factorization In mathematics, factorization (or factorisation, see American and British English spelling differences#-ise, -ize (-isation, -ization), English spelling differences) or factoring consists of writing a number or another mathematical object as a p ...
n = 2^g p_1^p_2^\cdots q_1^q_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

Gauss proved that for a squarefree number , :r_3(n) = \begin 24 h(-n), & \text n\equiv 3\pmod, \\ 0 & \text n\equiv 7\pmod, \\ 12 h(-4n) & \text, \end where denotes the class number of an integer . There exist extensions of Gauss' formula to arbitrary integer .


''k'' = 4

The number of ways to represent 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. Representing , where ''m'' is an odd integer, one can express r_4(n) in terms of the
divisor function In mathematics, and specifically in number theory, a divisor function is an arithmetic function related to the divisors of an integer. When referred to as ''the'' divisor function, it counts the ''number of divisors of an integer'' (includi ...
as follows: :r_4(n) = 8\sigma(2^m).


''k'' = 6

The number of ways to represent as the sum of six squares is given by :r_6(n) = 4\sum_ d^2\big( 4\left(\tfrac\right) - \left(\tfrac\right)\big), where \left(\tfrac\right) is the Kronecker symbol.


''k'' = 8

Jacobi also found an explicit formula for the case : :r_8(n) = 16\sum_(-1)^d^3.


Generating function

The
generating function In mathematics, a generating function is a representation of an infinite sequence of numbers as the coefficients of a formal power series. Generating functions are often expressed in closed form (rather than as a series), by some expression invo ...
of the
sequence In mathematics, a sequence is an enumerated collection of objects in which repetitions are allowed and order matters. Like a set, it contains members (also called ''elements'', or ''terms''). The number of elements (possibly infinite) is cal ...
r_k(n) for fixed can be expressed in terms of the
Jacobi theta function In mathematics, theta functions are special functions of several complex variables. They show up in many topics, including Abelian varieties, moduli spaces, quadratic forms, and solitons. Theta functions are parametrized by points in a tube do ...
: :\vartheta(0;q)^k = \vartheta_3^k(q) = \sum_^r_k(n)q^n, where :\vartheta(0;q) = \sum_^q^ = 1 + 2q + 2q^4 + 2q^9 + 2q^ + \cdots.


Numerical values

The first 30 values for r_k(n), \; k=1, \dots, 8 are listed in the table below:


See also

*
Integer partition In number theory and combinatorics, a partition of a non-negative integer , also called an integer partition, is a way of writing as a summation, sum of positive integers. Two sums that differ only in the order of their summands are considered ...
* Jacobi's four-square theorem * Gauss circle problem


References


Further reading


External links

* * *{{cite OEIS, A004018, Theta series of square lattice, r_2(n) Arithmetic functions Squares in number theory Integer factorization algorithms