Consider the Riemann $\zeta$ function. We know that $\zeta(2n)$ is a rational multiple of $\pi^{2n}$ (in particular is transcendental). We also know that $\zeta(3)$ is irrational, and we expect $\zeta(n)$ to be irrational (if not even transcendental) for every $n\in\mathbb{N}$, or at least I would be amazed if - say - $\zeta(5)$ turned out to be rational.

Are there known instances of rational numbers appearing where we would not have expected them?

Of course the notion of "expectation" here is very subjective, so this is a soft question just out of curiosity, since I have the feeling that usually (in my limited experience always) complicated expressions yield irrational ($\mathbb{C}-\mathbb{Q}$) numbers.

As a non-example, we have the series $\sum_{n=1}^\infty 2^{-n}=1$. A series is complicated enough (compared to say a finite arithmetic expression), but of course here we have the explicit formula for geometric series so the resulting $1$ is not really a big surprise.


Legrendre's Constant is the best example of this that I know. Legendre was interested in the expression

$$\lim_{n\to\infty}\left(\ln(x)-\frac{n}{\pi(n)}\right)$$ due to its relation to the (then unproven) Prime Number Theorem. In particular, if the limit exists then the prime number theorem is true. Legrendre estimated the value to be $\sim 1.08$ but the exact value turned out to be $1$! Although I don't know of any specific conjectures that it is irrational, the fact that it turns out to be exactly $1$ was highly surprising to me and I see no reason to expect it to be rational.

I would imagine that there are many examples of this in probability theory from before the Komogorov Zero-One Law was established.


The average distance between two randomly chosen points in the Sierpinski triangle (of side $1$) is

$$\frac{466}{885}$$

(where "distance" means the length of the shortest path between the points that lies within the Sierpinski triangle).