# §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

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 $\mathop{c_{k}\/}\nolimits\!\left(n\right)=\sum_{m=1}^{k}\mathop{\chi_{1}\/}% \nolimits\!\left(m\right)e^{2\pi\mathrm{i}mn/k},$ Defines: $\mathop{c_{\NVar{k}}\/}\nolimits\!\left(\NVar{n}\right)$: Ramanujan’s sum Symbols: $\mathop{\chi\/}\nolimits\!\left(\NVar{n}\right)$: Dirichlet character, $\pi$: the ratio of the circumference of a circle to its diameter, $\mathrm{e}$: base of exponential function, $k$: positive integer, $m$: positive integer and $n$: positive integer Permalink: http://dlmf.nist.gov/27.10.E4 Encodings: TeX, pMML, png See also: Annotations for 27.10

where $\mathop{\chi_{1}\/}\nolimits$ 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 $\mathop{c_{k}\/}\nolimits\!\left(n\right)=\sum_{d\mathbin{|}\left(n,k\right)}d% \mathop{\mu\/}\nolimits\!\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 $\mathop{G\/}\nolimits\!\left(n,\mathop{\chi\/}\nolimits\right)$ associated with a Dirichlet character $\mathop{\chi\/}\nolimits\pmod{k}$. It is defined by the relation

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

In particular, $\mathop{G\/}\nolimits\!\left(n,\mathop{\chi_{1}\/}\nolimits\right)=\mathop{c_{% k}\/}\nolimits\!\left(n\right)$.

$\mathop{G\/}\nolimits\!\left(n,\mathop{\chi\/}\nolimits\right)$ is separable for some $n$ if

 27.10.10 $\mathop{G\/}\nolimits\!\left(n,\mathop{\chi\/}\nolimits\right)=\overline{% \mathop{\chi\/}\nolimits}(n)\mathop{G\/}\nolimits\!\left(1,\mathop{\chi\/}% \nolimits\right).$

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

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

Conversely, if $\mathop{G\/}\nolimits\!\left(n,\mathop{\chi\/}\nolimits\right)$ is separable for every $n$, then $\mathop{\chi\/}\nolimits$ is primitive (mod $k$).

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

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