User:Virginia-American/Sandbox/Arithmetic function

In number theory, an arithmetic function or arithmetical function is a real or complex valued function f(n) defined on the set of natural numbers (i.e. positive integers) that "expresses some arithmetical property of n." .

An example of an arithmetic function is the non-principal character (mod 4) defined by
 * $$ \chi(n) := \left\{\begin{array}{cl} 0 & \mbox{if } n \mbox{ is even}, \\ 1 & \mbox{if } n \equiv 1 \mod 4, \\ -1 & \mbox{if } n \equiv 3 \mod 4.

\end{array}\right. $$

To emphasise that they are being thought of as functions rather than sequences, values of an arithmetic function are usually denoted by a(n) rather than an.

There is a larger class of number-theoretic functions that do not fit the above definition, e.g. the prime-counting functions. This article provides links to functions of both classes.

Notation
$$\sum_p f(p)\;$$  and   $$\prod_p f(p)\;$$   mean that the sum or product is over all prime numbers:


 * $$\sum_p f(p) = f(2) + f(3) + f(5) + \dots$$    $$\prod_p f(p)= f(2)f(3)f(5)\cdots$$

Similarly,  $$\sum_{p^k} f(p)\;$$   and   $$\prod_{p^k} f(p)\;$$   mean that the sum or product is over all prime powers (with positive exponent, so 1  is not counted):


 * $$\sum_{p^k} f(p) = f(2) + f(3) + f(4) +f(5) +f(7)+f(8)+f(9)+\dots$$

$$\sum_{d|n} f(d)\;$$  and   $$\prod_{d|n} f(p)\;$$   mean that the sum or product is over all positive divisors of n, including 1 and n. E.g., if n = 12,


 * $$\prod_{d|12} f(d) = f(1)f(2) f(3) f(4)  f(6)  f(12).\ $$

The notations can be combined:  $$\sum_{p|n} f(p)\;$$   and   $$\prod_{p|n} f(p)\;$$   mean that the sum or product is over all prime divisors of n. E.g., if n = 18,


 * $$\sum_{p|18} f(p) = f(2) + f(3),\ $$

and similarly  $$\sum_{p^k|n} f(p^k)\;$$   and   $$\prod_{p^k|n} f(p^k)\;$$   mean that the sum or product is over all prime powers dividing n. E.g., if n = 24,


 * $$\prod_{p^k|24} f(p^k) = f(2) f(3) f(4) f(8).\ $$

Multiplicative and additive functions
An arithmetic function a is


 * completely additive if a(mn) = a(m) + a(n) for all natural numbers m and n;


 * completely multiplicative if a(mn) = a(m)a(n) for all natural numbers m and n;

Two whole numbers m and n are called coprime if their greatest common divisor is 1; i.e., if there is no prime number that divides both of them.

Then an arithmetic function a is


 * additive if a(mn) = a(m) + a(n) for all coprime natural numbers m and n;


 * multiplicative if a(mn) = a(m)a(n) for all coprime natural numbers m and n.

Ω(n), ω(n), νp(n) - prime power decomposition
The fundamental theorem of arithmetic states that any positive integer n can be factorised uniquely as a product of powers of primes:  $$ n = p_1^{a_1}\ldots p_k^{a_k} $$   where  p1 < p2 < ... < pk are primes and the aj are positive integers. (1 is given by the empty product.)

It is often convenient to write this as an infinite product over all the primes, where all but a finite number have a zero exponent. Define νp(n) as the exponent of the highest power of the prime p that divides n. I.e. if p is one of the pi then νp(n) = ai, otherwise it is zero. Then


 * $$n=\prod_p p^{\nu_p(n)}.$$

In terms of the above the functions ω and Ω are defined by


 * ω(n) = k,
 * Ω(n) = a1 +   a2 + ... + ak.

To avoid repetition, whenever possible formulas for the functions listed in this article are given in terms of n and the corresponding pi, ai, ω, and Ω.

σk(n), τ(n), d(n) - divisor sums
σk(n) is the sum of the kth powers of of the positive divisors of n, including 1 and n, where k is a complex mumber.

σ1(n), the sum of the (positive) divisors of n, is usually denoted by σ(n). Since a positive number to the zero power is one,

σ0(n) is therefore the number of (positive) divisors of n; it is usually denoted by d(n) or τ(n) (for the German Teiler = dvisors).


 * $$\sigma_k(n) = \prod_{i=1}^{\omega(n)} \frac{p_{i}^{(a_{i}+1)k}-1}{p_{i}^k-1}

= \prod_{i=1}^{\omega(n)} (1 + p_{i}^k + p_{i}^{2k} + ... + p_{i}^{a_i k}). $$

Setting k = 0 in the second product gives


 * $$\tau(n) = d(n) = (1 + a_{1})(1+a_{2})\cdots(1+a_{\omega(n)}).$$

φ(n) - Euler totient function
φ(n), the Euler totient function, is the number of positive integers not greater than n that are coprime to n.


 * $$\phi(n) = n \prod_{p|n} \left(1-\frac{1}{p}\right)

=n \left(\frac{p_1 - 1}{p_1}\right)\left(\frac{p_2 - 1}{p_2}\right) \cdots \left(\frac{p_{\omega(n)} - 1}{p_{\omega(n)}}\right) .$$

μ(n) - Möbius function
μ(n), the Möbius function, is important because of the Möbius inversion formula. See Dirichlet convolution, below.


 * $$\mu(n)=\begin{cases} (-1)^{\omega(n)}=(-1)^{\Omega(n)} &\mbox{if }\; \omega(n) = \Omega(n)\\

0&\mbox{if }\;\omega(n) \ne \Omega(n)\end{cases}.$$

This implies that &mu;(1) = 1. (Because Ω(1) = ω(1) = 0.)

λ(n) - Liouville function
λ(n), the Liouville function, is defined by


 * $$\lambda (n) = (-1)^{\Omega(n)}.\;$$

χ(n) - characters
All Dirichlet characters χ(n) are completely multiplicative; e.g. the non-trivial character (mod 4) defined in the introduction, or the principal character (mod n) defined by
 * $$ \chi_0(k) = \begin{cases} 1 & \mbox{if } \gcd(k,n) = 1, \\ 0 & \mbox{if } \gcd(k,n) \ne 1.

\end{cases} $$

ω(n) - distinct prime divisors
ω(n), defined above as the number of distinct primes dividing n, is additive

Ω(n) - prime divisors
Ω(n), defined above as the number of prime factors of n counted with multiplicities, is completely additive.

νp(n) - prime power dividing n
For a fixed prime p, νp(n), defined above as the exponent of the largest power of p dividing n, is completely multiplicative.

π(x), Π(x), θ(x), ψ(x) - prime count functions
Unlike the other functions listed in this article, these are defined for non-negative real (not just integer) arguments. They are used in the statement and proof of the prime number theorem.

π(n), the prime counting function, is the number of primes not exceeding x.


 * $$\pi(x) = \sum_{p\le x}1

$$

A related function counts prime powers with weight 1 for primes, 1/2 for their squares, 1/3 for cubes, ...


 * $$\Pi(x) = \sum_{p^k\le x}\frac{1}{k}

$$

θ(x) and ψ(x), the Chebyshev functions are defined as sums of the natural logarithms of the primes not exceeding x:


 * $$\vartheta(x)=\sum_{p\le x} \log p,$$ and


 * $$ \psi(x) = \sum_{p^k\le x} \log p.$$

Λ(n) - von Mangoldt function
Λ(n), the von Mangoldt function, is 0 unless the argument is a prime power, in which case it is the natural log of the prime:


 * $$\Lambda(n) = \begin{cases}\log p &\mbox{if } n = p^k \mbox{ is a prime power}\\

0&\mbox{if } n \mbox{ is not a prime power}. \end{cases} $$

p(n) - partition function
p(n), the partition function, is the number of ways of representationing n as a sum of positive integers, where two representations with the same summands in a different order are not counted as being different:



p(n) = |\left\{ (a_1, a_2,\dots a_k): 0 < a_1 \le a_2\dots \le a_k\; \land \;n=a_1+a_2+\dots +a_k \right\}| $$

λ(n) - Carmichael function
λ(n), the Carmichael function, is the smallest positive number such that $$a^{\lambda(n)}\equiv 1 \pmod{n}$$  for all a coprime to n.

For prime powers it is equal to the Euler totient function (for 2, 4, and odd prime powers) or to one-half the totient (for powers of 2 greater than 4):


 * $$\lambda(n) =

\begin{cases} \;\;\phi(n) &\mbox{if }n = 2,3,4,5,7,9,11,13,17,19,23,25,27,\dots\\ \tfrac12\phi(n)&\mbox{if }n=8,16,32,64,\dots \end{cases} $$

and for general n it is the least common multiple of λ of each of its prime power factors:


 * $$\lambda(n) = \operatorname{lcm}[\lambda(p_1^{a_1}),\;\lambda(p_2^{a_2}),\;\dots\;,\lambda(p_{\omega(n)}^{a_{\omega(n)}}) ].

$$

h(n) - Class number
h(n), the class number function, is the order of the ideal class group of an algebraic extension of the rationals with discriminant n. The notation is ambiguous, as there are in general many extensions with the same discriminant. See quadratic field and cyclotomic field for classical examples.

rk(n) - Sum of k squares
rk(n) is the number of ways n can be be represented 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.


 * $$r_k(n) = |\{(a_1, a_2,\dots,a_k):n=a_1^2+a_2^2+\dots+a_k^2\}|

$$

Summation functions
Given an arithmetic function a(n), its summation function A(x) is defined by
 * $$ A(x) := \sum_{n \le x} a(n) .$$

A can be regarded as a function of a real variable. Given a positive integer m, A is constant along open intervals m < x < m + 1, and has a jump discontinuity at each integer for which a(m) ≠ 0.

Since such functions are often represented by series and integrals, to achieve pointwise convergence it is usual to define the value at the discontinuities as the average of the values to the left and right:


 * $$ A_0(x) := \frac12\left(\sum_{n < x} a(n) +\sum_{n \le x} a(n)\right) .$$

Individual values of arithmetic functions may fluctuate wildly - as in most of the above examples. Summation functions "smooth out" these fluctuations. In some cases it may be possible to find asymptotic behaviour for the summation function for large x.

A classical example of this phenomenon is given by d(n), the number of divisors of n:


 * $$\liminf_{n\to\infty}d(n) = 2

$$


 * $$\limsup_{n\to\infty}\frac{\log d(n) \log\log n}{\log n} = \log 2

$$


 * $$\lim_{n\to\infty}\frac{d(1) + d(2)+ \dots+d(n)}{\log(1) + \log(2)+ \dots+\log(n)} = 1.

$$

Dirichlet convolution
Given an arithmetic function a(n), let Fa(s), for complex s, be the function defined by the corresponding Dirichlet series (where it converges):
 * $$ F_a(s) := \sum_{n=1}^{\infty} \frac{a(n)}{n^s} .$$

Fa(s) is called a generating function of a(n). The simplest such series, corresponding to the constant function a(n) = 1 for all n, is ς(s) the Riemann zeta function.

The generating function of the Möbius function is the inverse of the zeta function:



\zeta(s)\;\;\sum_{n=1}^\infty\frac{\mu(n)}{n^s}=1. $$

Consider two arithmetic functions a and b and their respective generating functions Fa(s) and Fb(s). The product Fa(s)Fb(s) can be computed as follows:
 * $$ F_a(s)F_b(s) = \left( \sum_{m=1}^{\infty}\frac{a(m)}{m^s} \right)\left( \sum_{n=1}^{\infty}\frac{b(n)}{n^s} \right) . $$

It is a straightforward exercise to show that if c(n) is defined by


 * $$ c(n) := \sum_{ij = n} a(i)b(j) = \sum_{i|n}a(i)b\left(\frac{n}{i}\right), $$

then


 * $$F_c(s) =F_a(s) F_b(s).\;

$$

This function c is called the Dirichlet convolution of a and b, and is denoted by $$a*b$$.

A particularly important case is convolution with the constant function a(n) = 1 for all n, corresponding to multiplying the generating function by the zeta function:



g(n) = \sum_{d|n}f(d).\; $$

Multiplying by the inverse of the zeta function gives the Möbius inversion formula:



f(n) = \sum_{d|n}\mu\left(\frac{n}{d}\right)g(d). $$

If f is multiplicative, then so is g. If f is completely multiplicative, then g is multiplicative, but may or may not be completely multiplicative. The article multiplicative function has a short proof.

Relations among the functions
There are a great many formulas connecting arithmetical functions with each other and with the other functions of analysis - in fact, a large part of elementary and analytic number theory is a detailed study of these relations. See the articles on the individual functions for details.

Here are a few examples:


 * $$r_2(n) = 4\sum_{d|n}\chi(d),\

$$    where &chi; is the nonprincipal character (mod 4) defined in the introduction.



r_4(n) = 24 \sum_{\stackrel{d\,|\,n}{ 4\, \nmid \,d}}d $$



\sum_{d|n}\phi(d) = n\; $$



\sum_{d|n}\Lambda(d) =\log n\; $$



\sum_{d|n}\mu(d)= \begin{cases} 1&\mbox{if } n =1\\ 0&\mbox{if } n \ne 1 \end{cases} $$



\sum_{d|n}|\mu(d)| =2^{\omega(n)}\; $$



\sum_{d|n}\lambda(d)= \begin{cases} 1&\mbox{if } n \mbox{ is a square}\\ 0&\mbox{if } n \mbox{ is not a square} \end{cases} $$  where &lambda; is the Liouville function.



\frac{6}{\pi^2}<\frac{\phi(n)\sigma(n)}{n^2}<1\; $$



\sigma_7(n) = \sigma_3(n) + 120\sum_{k=1}^{n-1}\sigma_3(k)\sigma_3(n-k)\; $$



\psi(x)=\sum_{n\le x}\Lambda(n) =\log \operatorname{lcm}[1,2,\dots,\lfloor x\rfloor]\; $$

Class Number related
Dirichlet discovered formulas that relate the class number h of quadratic number fields to the Jacobi symbol.

An integer D is called a fundamental discriminant it it is the discriminant of a quadratic number field. This is equivalent to D ≠ 1 and either a) D is squarefree and D &equiv; 1 (mod 4) or b) D &equiv; 0 (mod 4), D/4  is squarefree, and D/4 &equiv; 2 or 3 (mod 4).

Extend the Jacobi symbol to accept even numbers in the "denominator" by defining the Kronecker symbol:



\left(\frac{a}{2}\right) = \begin{cases} \;\;\,0&\mbox{ if } a \mbox{ is even} \\(-1)^{\frac{a^2-1}{8}}&\mbox{ if }a \mbox{ is odd. } \end{cases}$$

Then if D < −4 is a fundamental discriminant



\begin{align} h(D) & = \frac{1}{D} \sum_{r=1}^{|D|}r\left(\frac{D}{r}\right)\\ & = \frac{1}{2-\left(\tfrac{D}{2}\right)} \sum_{r=1}^{|D|/2}\left(\frac{D}{r}\right). \end{align} $$

There is also a formula relating r3 and h. Again, let D be a fundamental discriminant, D < −4. Then:



r_3(|D|) = 12\left(1-\left(\frac{D}{2}\right)\right)h(D) $$