In number theory, an arithmetic, arithmetical, or number-theoretic function[1][2] is generally any function f(n) whose domain is the positive integers and whose range is a subset of the complex numbers.[3][4][5] Hardy & Wright include in their definition the requirement that an arithmetical function "expresses some arithmetical property of n".[6] 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.
An example of an arithmetic function is the divisor function whose value at a positive integer n is equal to the number of divisors of n.
Arithmetic functions are often extremely irregular (see table), but some of them have series expansions in terms of Ramanujan's sum.