Sum of squares function
   HOME

TheInfoList



OR:

In
number theory Number theory (or arithmetic or higher arithmetic in older usage) is a branch of pure mathematics devoted primarily to the study of the integers and integer-valued functions. German mathematician Carl Friedrich Gauss (1777–1855) said, "Mat ...
, the sum of squares function is an
arithmetic function In number theory, an arithmetic, arithmetical, or number-theoretic function is for most authors any function ''f''(''n'') whose domain is the positive integers and whose range is a subset of the complex numbers. Hardy & Wright include in their d ...
that gives the number of
representations ''Representations'' is an interdisciplinary journal in the humanities published quarterly by the University of California Press. The journal was established in 1983 and is the founding publication of the New Historicism movement of the 1980s. It ...
for a given positive
integer An integer is the number zero (), a positive natural number (, , , etc.) or a negative integer with a minus sign ( −1, −2, −3, etc.). The negative numbers are the additive inverses of the corresponding positive numbers. In the languag ...
as the sum of
squares In Euclidean geometry, a square is a regular quadrilateral, which means that it has four equal sides and four equal angles (90- degree angles, π/2 radian angles, or right angles). It can also be defined as a rectangle with two equal-length a ...
, where representations that differ only in the order of the
summand Addition (usually signified by the plus symbol ) is one of the four basic operations of arithmetic, the other three being subtraction, multiplication and division. The addition of two whole numbers results in the total amount or '' sum'' of ...
s or in the signs of the numbers being squared are counted as different, and is denoted by .


Definition

The
function Function or functionality may refer to: Computing * Function key, a type of key on computer keyboards * Function model, a structured representation of processes in a system * Function object or functor or functionoid, a concept of object-oriente ...
is defined as :r_k(n) = , \, where , \,\ , denotes the cardinality of a set. 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 those numbers used for counting (as in "there are ''six'' coins on the table") and ordering (as in "this is the ''third'' largest city in the country"). Numbers used for counting are called ''cardinal ...
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 In mathematics, a divisor of an integer n, also called a factor of n, is an integer m that may be multiplied by some integer to produce n. In this case, one also says that n is a multiple of m. An integer n is divisible or evenly divisible by ...
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 mod ...
to 1 modulo 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 English spelling differences) or factoring consists of writing a number or another mathematical object as a product of several ''factors'', usually smaller or simpler objects of the same kind ...
n = 2^g p_1^p_2^\cdots q_1^q_2^\cdots , where p_i are the
prime factors A prime number (or a prime) is a natural number greater than 1 that is not a product of two smaller natural numbers. A natural number greater than 1 that is not prime is called a composite number. For example, 5 is prime because the only ways ...
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 In mathematics, a square-free integer (or squarefree integer) is an integer which is divisible by no square number other than 1. That is, its prime factorization has exactly one factor for each prime that appears in it. For example, is square-fr ...
, :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 .


''k'' = 4

The number of ways to represent as the sum of four squares was due to
Carl Gustav Jakob Jacobi Carl Gustav Jacob Jacobi (; ; 10 December 1804 – 18 February 1851) was a German mathematician who made fundamental contributions to elliptic functions, dynamics, differential equations, determinants, and number theory. His name is occasional ...
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'' (includin ...
as follows: :r_4(n) = 8\sigma(2^m).


''k'' = 8

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


Generating function

The generating function 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 calle ...
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. As Grassmann algebras, they appear in quantum field theo ...
: :\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

*
Jacobi's four-square theorem Jacobi's four-square theorem gives a formula for the number of ways that a given positive integer ''n'' can be represented as the sum of four squares. History The theorem was proved in 1834 by Carl Gustav Jakob Jacobi. Theorem Two representati ...
* Gauss circle problem


References


External links

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