# Dirichlet’s function

Dirichlet’s function $f:\mathbb{R}\to\mathbb{R}$ is defined as

 $f\left(x\right)=\left\{\begin{array}[]{ll}\frac{1}{q}&\textrm{if }x=\frac{p}{q% }\textrm{ is a rational number in lowest terms,}\\ 0&\textrm{if }x\textrm{ is an irrational number.}\end{array}\right.$

Another function that often goes by the same name is the function

 $f\left(x\right)=\left\{\begin{array}[]{ll}1&\textrm{if }x\textrm{ is an % rational number.}\\ 0&\textrm{if }x\textrm{ is an irrational number.}\end{array}\right.$

This nowhere-continuous function has the surprising expression

 $\displaystyle f(x)=\lim_{m\to\infty}\lim_{n\to\infty}\cos^{2n}(m!\pi x).$

This is often given as the (amazing!) example of a sequence of everywhere-continuous functions whose limit function is nowhere continuous.

Title Dirichlet’s function DirichletsFunction 2013-03-22 13:11:14 2013-03-22 13:11:14 mathcam (2727) mathcam (2727) 9 mathcam (2727) Definition msc 26A15 FunctionContinuousAtOnlyOnePoint APathologicalFunctionOfRiemann