Function that maps the "pureness" of a rational number?

You can take, $$\frac{a}{b}\mapsto \frac{a+b}{\gcd(a,b)},$$ Note that this is independent of the choice of representative since $\gcd(na,nb)=n\gcd(a,b)$ for non-negative integers $n$.

For your examples, $$\frac{1}{1}\mapsto 2,\quad \frac{1}{2}\mapsto 3,\quad\frac{2}{3}\mapsto 5,\quad\frac{53}{41}\mapsto 94.$$

Another possibility is $$\frac{a}{b}\mapsto \frac{ab}{(\gcd(a,b))^2},$$ which yields $$\frac{1}{1}\mapsto 1,\quad\frac{1}{2}\mapsto 2,\quad\frac{2}{3}\mapsto 6,\quad\frac{53}{41}\mapsto 2173.$$

Both these "pureness" functions have the property that $a/b$ is as pure as $b/a$, as we would expect.

The following table shows how the first choice partitions the positive rationals into "pureness classes". Each row corresponds to rationals of the same pureness.

$$ \begin{align} & \frac{1}{1} \\ & \frac{1}{2}\quad\frac{2}{1} \\ & \frac{1}{3}\quad\frac{3}{1} \\ & \frac{1}{4}\quad\frac{2}{3}\quad\frac{3}{2}\quad\frac{4}{1} \\ & \frac{1}{5}\quad\frac{5}{1} \\ & \frac{1}{6}\quad\frac{2}{5}\quad\frac{3}{4}\quad\frac{4}{3}\quad\frac{2}{5}\quad\frac{6}{1} \\ & \frac{1}{7}\quad\frac{3}{5}\quad\frac{5}{3}\quad\frac{7}{1} \\ & \frac{1}{8}\quad\frac{2}{7}\quad\frac{4}{5}\quad\frac{5}{4}\quad\frac{7}{2}\quad\frac{8}{1} \\ & \frac{1}{9}\quad\frac{3}{7}\quad\frac{7}{3}\quad\frac{9}{1} \\ & \frac{1}{10}\quad\frac{2}{9}\quad\frac{3}{8}\quad\frac{4}{7}\quad\frac{5}{6}\quad\frac{6}{5}\quad\frac{7}{4}\quad\frac{8}{3}\quad\frac{9}{2}\quad\frac{10}{1} \end{align} $$


I have often used the sum of the terms in the Continued Fraction. This is

  1. finite for rational numbers
  2. the same for $x$ and $\frac1x$
  3. for $0\lt x\lt 1$, the same for $x$ and $1-x$

$$ 1=(1)\to1 $$ $$ \frac12=(0,2)\to2\quad\text{and}\quad2=(2)\to2 $$ $$ \frac23=(0,1,2)\to3 $$ $$ \frac{53}{41}=(1,3,2,2,2)\to10 $$ etc.


The order of the Farey sequence where the (fractional part) of the rational number first occurs is a measure that should be of interest to you. As you will see from the link, the Farey sequences have many fascinating properties.


A natural pureness measure is the level of the Stern-Brocot tree at which the fraction occurs. Since each run of consecutive left or right steps in the tree corresponds to a continued fraction term equal to the length of the run, the pureness may be defined as the sum of the continued fraction terms.


In the same spirit as Rob Arthan's answer, you could use the first time a rational number appears in the Calfin-Wilf sequence.

Define a sequence $a_n$ with $a_0 = 0$, $a_1 = 1$ obeying the recurrences $a_{2n} = a_n$ and $a_{2n + 1} = a_n + a_{n+1}$. We get

$$0, 1, 1, 2, 1, 3, 2, 3, 1, 4, 3, 5, \ldots$$

The Calfin-Wilf sequence is $c_n = a_n / a_{n+1}$:

$$\frac{0}{1},\frac{1}{1}, \frac{1}{2}, \frac{2}{1}, \frac{1}{3}, \frac{3}{2}, \ldots$$

Every positive rational number appears exactly once in this sequence. Thus with this measure of "purity", you can always tell which of two rational numbers is "purer".