# Takagi function

The Takagi function (also called the blancmange function) is defined by $$\mathrm{takagi}(x)=\displaystyle\sum_{k=0}^{\infty} \dfrac{\mathrm{dist}_{\mathbb{Z}}(2^n x)}{2^n},$$ where $\mathrm{dist}_{\mathbb{Z}}$ denotes the distance to integers function.