Approximating a number with $a^b$ or $\sqrt[b]{a}$ for $a,b \in \mathbb{N}$

67 Views Asked by At

If one wants to approximate some number $x$ as the ratio of two integers $a$ and $b$, it is possible to simply consider its continued fraction and truncate it. Example: $$\pi=[3; 7, 15, 1, 292, 1, 1, 1,...]$$ $$\pi\approx[3; 7, 15, 1]=\frac{355}{113}$$ Is there a similar non brute force process if one wants to get the closest integer power to some positive $x$? That is, to obtain the best $a^b\approx x$ such that $a,b \in \mathbb{N}$.

I noticed that the brute force method can be restricted to checking every $b$ in the interval $[2,\log_2(x)]$ and the corresponding $a$ with $\lfloor \sqrt[b]{x} \rceil$, but I don't know if this can be improved.

Another, and more general, possibility is to approximate $x$ using the bth root, instead of the bth power, that is, with $\sqrt[b]{a}$. There are famous examples, such as $\pi\approx\sqrt[3]{31}$. This case seems more interesting and useful, yet more unclear, as there are infinite solutions, similar to the continued fraction convergents.