# §27.10 Periodic Number-Theoretic Functions

If $k$ is a fixed positive integer, then a number-theoretic function $f$ is periodic (mod $k$) if

 27.10.1 $f(n+k)=f(n),$ $n=1,2,\dots$. ⓘ Symbols: $k$: positive integer, $n$: positive integer and $f(n)$: function Permalink: http://dlmf.nist.gov/27.10.E1 Encodings: TeX, pMML, png See also: Annotations for §27.10 and Ch.27

Examples are the Dirichlet characters (mod $k$) and the greatest common divisor $\left(n,k\right)$ regarded as a function of $n$.

Every function periodic (mod $k$) can be expressed as a finite Fourier series of the form

 27.10.2 $f(n)=\sum_{m=1}^{k}g(m)e^{2\pi\mathrm{i}mn/k},$

where $g(m)$ is also periodic (mod $k$), and is given by

 27.10.3 $g(m)=\dfrac{1}{k}\sum_{n=1}^{k}f(n)e^{-2\pi\mathrm{i}mn/k}.$

An example is Ramanujan’s sum:

 27.10.4 $c_{k}\left(n\right)=\sum_{m=1}^{k}\chi_{1}\left(m\right)e^{2\pi\mathrm{i}mn/k},$ ⓘ Defines: $c_{\NVar{k}}\left(\NVar{n}\right)$: Ramanujan’s sum Symbols: $\chi\left(\NVar{n}\right)$: Dirichlet character, $\pi$: the ratio of the circumference of a circle to its diameter, $\mathrm{e}$: base of natural logarithm, $\mathrm{i}$: imaginary unit, $k$: positive integer, $m$: positive integer, $n$: positive integer and $\chi$: Dirichlet character Permalink: http://dlmf.nist.gov/27.10.E4 Encodings: TeX, pMML, png See also: Annotations for §27.10 and Ch.27

where $\chi_{1}$ is the principal character (mod $k$). This is the sum of the $n$th powers of the primitive $k$th roots of unity. It can also be expressed in terms of the Möbius function as a divisor sum:

 27.10.5 $c_{k}\left(n\right)=\sum_{d\mathbin{|}\left(n,k\right)}d\mu\left(\frac{k}{d}% \right).$

More generally, if $f$ and $g$ are arbitrary, then the sum

 27.10.6 $s_{k}(n)=\sum_{d\mathbin{|}\left(n,k\right)}f(d)g\left(\frac{k}{d}\right)$

is a periodic function of $n\pmod{k}$ and has the finite Fourier-series expansion

 27.10.7 $s_{k}(n)=\sum_{m=1}^{k}a_{k}(m)e^{2\pi\mathrm{i}mn/k},$

where

 27.10.8 $a_{k}(m)=\sum_{d\mathbin{|}\left(m,k\right)}g(d)f\left(\frac{k}{d}\right)\frac% {d}{k}.$

Another generalization of Ramanujan’s sum is the Gauss sum $G\left(n,\chi\right)$ associated with a Dirichlet character $\chi\pmod{k}$. It is defined by the relation

 27.10.9 $G\left(n,\chi\right)=\sum_{m=1}^{k}\chi\left(m\right)e^{2\pi\mathrm{i}mn/k}.$ ⓘ Defines: $G\left(\NVar{n},\NVar{\chi}\right)$: Gauss sum Symbols: $\chi\left(\NVar{n}\right)$: Dirichlet character, $\pi$: the ratio of the circumference of a circle to its diameter, $\mathrm{e}$: base of natural logarithm, $\mathrm{i}$: imaginary unit, $k$: positive integer, $m$: positive integer, $n$: positive integer and $\chi$: Dirichlet character Permalink: http://dlmf.nist.gov/27.10.E9 Encodings: TeX, pMML, png See also: Annotations for §27.10 and Ch.27

In particular, $G\left(n,\chi_{1}\right)=c_{k}\left(n\right)$.

$G\left(n,\chi\right)$ is separable for some $n$ if

 27.10.10 $G\left(n,\chi\right)=\overline{\chi}(n)G\left(1,\chi\right).$

For any Dirichlet character $\chi\pmod{k}$, $G\left(n,\chi\right)$ is separable for $n$ if $\left(n,k\right)=1$, and is separable for every $n$ if and only if $G\left(n,\chi\right)=0$ whenever $\left(n,k\right)>1$. For a primitive character $\chi\pmod{k}$, $G\left(n,\chi\right)$ is separable for every $n$, and

 27.10.11 $|G\left(1,\chi\right)|^{2}=k.$

Conversely, if $G\left(n,\chi\right)$ is separable for every $n$, then $\chi$ is primitive (mod $k$).

The finite Fourier expansion of a primitive Dirichlet character $\chi\pmod{k}$ has the form

 27.10.12 $\chi\left(n\right)=\frac{G\left(1,\chi\right)}{k}\sum_{m=1}^{k}\overline{\chi}% (m)e^{-2\pi\mathrm{i}mn/k}.$