Famous irrational constants whose $n$th digit can be computed in constant time?

113 Views Asked by At

The BBP formula for $\pi$ runs in $O(n \log n)$. I was wondering if there are irrational constants whose $n$-th digit can be computed in time $O(1)$ or at most $O(\log n)$.

2

There are 2 best solutions below

5
On

The number $$\sum_{k=1}^\infty\frac1{10^{10^k}}$$ is irrational. With good marketing can become as famous as $\pi$.

0
On

Let $S$ be the set of all natural numbers starting with $11$ in some fixed base $b$ (if operating on a binary computer, pick $b=2$). Then $S$ does not have a natural density, which precludes it from being eventually periodic. Thus $\sum_{n\in S} 10^{-n}$ is irrational, and any digit can be computed in constant time for a reasonable representation of the index.