Given a strictly positive real number $x$ we set $e(x)=\log(1+x)$ if $x$ is an integer and $$e(x)=\log(1+x)+\frac{1+\lbrace x\rbrace}{1+x}\left(e(1/\lbrace x\rbrace)-\log(1+\lbrace x\rbrace)\right)$$ otherwise (i.e. if the fractional part $\lbrace x\rbrace$ of $x$ is strictly positive).

This defines $e(x)$ if $x$ is rational and the recursive definition of $e(x)$ yields its value as a (perhaps infinite) limit if $x$ is irrational.

The real number $e(x)$ can be interpreted as an entropy (or information content) as follows: Consider the segment $[-1,x]$ endowed with the uniform probability law. Apply to the positive and to the negative part of this segment iteratedly the Euclidean Algorithm (removing from the longer piece a segment of length the length of the shorter piece). This yields a partition of $[-1,x]$ into finitely many segments if $x$ is rational and into infinitely many segments accumulating at the origin otherwise. The function $e(x)$ is simply a normalized entropy of this partition ($e(x)$ is essentially the expected amount of information on the position of a random point on $[-1,x]$ which can be inferred when only knowing the interval containing the random point).

We illustrate this with $x=5/19$. We start with the interval $[-1,5/19]$. Since only proportions matter, we replace it by $[-19,5]$ in order to work over $\mathbb Z$. The positive interval $[0,5]$ is shorter than the negative interval $[-19,0]$. We therefore cut a piece of length $5$ from the negative interval in order to get $[-14,5]$. Iteration yields then $[-9,5]$ and $[-4,5]$. At this point the negative interval is shorter and we get therefore $[-4,1]$. The positive interval $[0,1]$ is now shortest leading to $[-3,1],[-2,1],[-1,1]$ and finally $[ 0,1]$. We get therefore the partition of $[-19,5]$ into intervals $[-19,-14],[-14,-9],[-9,-4],[-4,-3],[-3,-2],[-2,-1],[-1,0],[0,1],[1,5]$. Endowing the interval $[-19,5]$ with the uniform probability measure $\mu$ (with probability of an interval given by its length divided by the total length $19+5=24$) the topological entropy of this partition is given by $$e(5/19)=-\frac{1}{24}(5\log(5/24)+5\log(5/24)+5\log(5/24)+5\cdot 1\log(1/24)+4\log(4/24))$$ and gives the expected amount of information (up to $\log(2)$ when working with bits, I guess) encoded by the partition.

A few easy facts:

$e(x)=e(1/x)$ (obvious from the definition).

$e(x)$ is discontinous at every rational value (it is in fact unbounded in the neighbourhood of a rational value) but should be continuous on a set of full measure. $e(x)$ is infinite at some irrational values with very huge coefficients in their continued fraction expansion.

The graph of $e(x)$ is a beautiful fractal.

The function $x\longmapsto e(x)$ is probably locally integrable.

It would be somewhat surprising if nobody has ever looked at this notion.

*Are there paper, references etc. on this notion?*