\begin{definition}[Definition:Kaprekar Mapping]
The '''Kaprekar mapping''' is the arithmetic function $K: \Z_{>0} \to \Z_{>0}$ defined on the positive integers  as follows:
Let $n \in \Z_{>0}$ be expressed in some number base $b$ (where $b$ is usually $10$).
Let $n'$ be the positive integer created by arranging the digits of $n$ into descending order of size.
Let $n''$ be the positive integer created by arranging the digits of $n$ into ascending order of size.
Then:
:$K \left({n}\right) = n' - n''$
making sure to retain any leading zeroes to ensure that $K \left({n}\right)$ has the same number of digits as $n$.
\end{definition}