In number theory, 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 numbers being squared are counted as different. It is denoted by rk(n).
The function is defined as
where denotes the cardinality of a set. In other words, rk(n) is the number of ways n can be written as a sum of 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.
• | Squares (and thus integer distances) in red |
• | Non-unique representations (up to rotation and reflection) bolded |
The number of ways to write a natural number as sum of two squares is given by r2(n). It is given explicitly by
where d1(n) is the number of divisors of n which are congruent to 1 modulo 4 and d3(n) is the number of divisors of 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
Gauss proved that for a squarefree number n > 4,
where h(m) denotes the class number of an integer m.
There exist extensions of Gauss' formula to arbitrary integer n. [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.
Representing n = 2km, where m is an odd integer, one can express in terms of the divisor function as follows:
The number of ways to represent n as the sum of six squares is given by
where is the Kronecker symbol. [3]
Jacobi also found an explicit formula for the case k = 8: [3]
The generating function of the sequence for fixed k can be expressed in terms of the Jacobi theta function: [4]
where
The first 30 values for are listed in the table below:
n | = | r1(n) | r2(n) | r3(n) | r4(n) | r5(n) | r6(n) | r7(n) | r8(n) |
---|---|---|---|---|---|---|---|---|---|
0 | 0 | 1 | 1 | 1 | 1 | 1 | 1 | 1 | 1 |
1 | 1 | 2 | 4 | 6 | 8 | 10 | 12 | 14 | 16 |
2 | 2 | 0 | 4 | 12 | 24 | 40 | 60 | 84 | 112 |
3 | 3 | 0 | 0 | 8 | 32 | 80 | 160 | 280 | 448 |
4 | 22 | 2 | 4 | 6 | 24 | 90 | 252 | 574 | 1136 |
5 | 5 | 0 | 8 | 24 | 48 | 112 | 312 | 840 | 2016 |
6 | 2×3 | 0 | 0 | 24 | 96 | 240 | 544 | 1288 | 3136 |
7 | 7 | 0 | 0 | 0 | 64 | 320 | 960 | 2368 | 5504 |
8 | 23 | 0 | 4 | 12 | 24 | 200 | 1020 | 3444 | 9328 |
9 | 32 | 2 | 4 | 30 | 104 | 250 | 876 | 3542 | 12112 |
10 | 2×5 | 0 | 8 | 24 | 144 | 560 | 1560 | 4424 | 14112 |
11 | 11 | 0 | 0 | 24 | 96 | 560 | 2400 | 7560 | 21312 |
12 | 22×3 | 0 | 0 | 8 | 96 | 400 | 2080 | 9240 | 31808 |
13 | 13 | 0 | 8 | 24 | 112 | 560 | 2040 | 8456 | 35168 |
14 | 2×7 | 0 | 0 | 48 | 192 | 800 | 3264 | 11088 | 38528 |
15 | 3×5 | 0 | 0 | 0 | 192 | 960 | 4160 | 16576 | 56448 |
16 | 24 | 2 | 4 | 6 | 24 | 730 | 4092 | 18494 | 74864 |
17 | 17 | 0 | 8 | 48 | 144 | 480 | 3480 | 17808 | 78624 |
18 | 2×32 | 0 | 4 | 36 | 312 | 1240 | 4380 | 19740 | 84784 |
19 | 19 | 0 | 0 | 24 | 160 | 1520 | 7200 | 27720 | 109760 |
20 | 22×5 | 0 | 8 | 24 | 144 | 752 | 6552 | 34440 | 143136 |
21 | 3×7 | 0 | 0 | 48 | 256 | 1120 | 4608 | 29456 | 154112 |
22 | 2×11 | 0 | 0 | 24 | 288 | 1840 | 8160 | 31304 | 149184 |
23 | 23 | 0 | 0 | 0 | 192 | 1600 | 10560 | 49728 | 194688 |
24 | 23×3 | 0 | 0 | 24 | 96 | 1200 | 8224 | 52808 | 261184 |
25 | 52 | 2 | 12 | 30 | 248 | 1210 | 7812 | 43414 | 252016 |
26 | 2×13 | 0 | 8 | 72 | 336 | 2000 | 10200 | 52248 | 246176 |
27 | 33 | 0 | 0 | 32 | 320 | 2240 | 13120 | 68320 | 327040 |
28 | 22×7 | 0 | 0 | 0 | 192 | 1600 | 12480 | 74048 | 390784 |
29 | 29 | 0 | 8 | 72 | 240 | 1680 | 10104 | 68376 | 390240 |
30 | 2×3×5 | 0 | 0 | 48 | 576 | 2720 | 14144 | 71120 | 395136 |
In number theory, an arithmetic, arithmetical, or number-theoretic function is generally 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 definition the requirement that an arithmetical function "expresses some arithmetical property of n". There is a larger class of number-theoretic functions that do not fit this definition, for example, the prime-counting functions. This article provides links to functions of both classes.
In mathematics, the Chinese remainder theorem states that if one knows the remainders of the Euclidean division of an integer n by several integers, then one can determine uniquely the remainder of the division of n by the product of these integers, under the condition that the divisors are pairwise coprime.
In number theory, a Carmichael number is a composite number which in modular arithmetic satisfies the congruence relation:
In mathematics, the Euclidean algorithm, or Euclid's algorithm, is an efficient method for computing the greatest common divisor (GCD) of two integers (numbers), the largest number that divides them both without a remainder. It is named after the ancient Greek mathematician Euclid, who first described it in his Elements . It is an example of an algorithm, a step-by-step procedure for performing a calculation according to well-defined rules, and is one of the oldest algorithms in common use. It can be used to reduce fractions to their simplest form, and is a part of many other number-theoretic and cryptographic calculations.
In number theory, the Legendre symbol is a multiplicative function with values 1, −1, 0 that is a quadratic character modulo of an odd prime number p: its value at a (nonzero) quadratic residue mod p is 1 and at a non-quadratic residue (non-residue) is −1. Its value at zero is 0.
The Jacobi symbol is a generalization of the Legendre symbol. Introduced by Jacobi in 1837, it is of theoretical interest in modular arithmetic and other branches of number theory, but its main use is in computational number theory, especially primality testing and integer factorization; these in turn are important in cryptography.
In number theory, Euler's criterion is a formula for determining whether an integer is a quadratic residue modulo a prime. Precisely,
In number theory, a probable prime (PRP) is an integer that satisfies a specific condition that is satisfied by all prime numbers, but which is not satisfied by most composite numbers. Different types of probable primes have different specific conditions. While there may be probable primes that are composite, the condition is generally chosen in order to make such exceptions rare.
In arithmetic, an odd composite integer n is called an Euler pseudoprime to base a, if a and n are coprime, and
In algebra and number theory, Wilson's theorem states that a natural number n > 1 is a prime number if and only if the product of all the positive integers less than n is one less than a multiple of n. That is, the factorial satisfies
In number theory, the partition functionp(n) represents the number of possible partitions of a non-negative integer n. For instance, p(4) = 5 because the integer 4 has the five partitions 1 + 1 + 1 + 1, 1 + 1 + 2, 1 + 3, 2 + 2, and 4.
A hexagonal number is a figurate number. The nth hexagonal number hn is the number of distinct dots in a pattern of dots consisting of the outlines of regular hexagons with sides up to n dots, when the hexagons are overlaid so that they share one vertex.
In number theory, quadratic Gauss sums are certain finite sums of roots of unity. A quadratic Gauss sum can be interpreted as a linear combination of the values of the complex exponential function with coefficients given by a quadratic character; for a general character, one obtains a more general Gauss sum. These objects are named after Carl Friedrich Gauss, who studied them extensively and applied them to quadratic, cubic, and biquadratic reciprocity laws.
In number theory, the Kronecker symbol, written as or , is a generalization of the Jacobi symbol to all integers . It was introduced by Leopold Kronecker.
Lucas pseudoprimes and Fibonacci pseudoprimes are composite integers that pass certain tests which all primes and very few composite numbers pass: in this case, criteria relative to some Lucas sequence.
In number theory, a branch of mathematics, the Carmichael functionλ(n) of a positive integer n is the smallest member of the set of positive integers m having the property that
In mathematics, Hensel's lemma, also known as Hensel's lifting lemma, named after Kurt Hensel, is a result in modular arithmetic, stating that if a univariate polynomial has a simple root modulo a prime number p, then this root can be lifted to a unique root modulo any higher power of p. More generally, if a polynomial factors modulo p into two coprime polynomials, this factorization can be lifted to a factorization modulo any higher power of p.
In additive number theory, Fermat's theorem on sums of two squares states that an odd prime p can be expressed as:
Anatoly Alexeyevich Karatsuba was a Russian mathematician working in the field of analytic number theory, p-adic numbers and Dirichlet series.
In number theory, the Fermat quotient of an integer a with respect to an odd prime p is defined as
Grosswald, Emil (1985). Representations of integers as sums of squares. Springer-Verlag. ISBN 0387961267.