Accuracy of approximating $\pi$ as n-th root of an integer I was watching a YouTube short the other day, and he talked about approximating $\pi$ as n-th root of an integer. So, I was like, 'surely I can just calculate $\pi^n$ and round it'.  After that, I realize that I can actually count how many digits does the approximation got right. So, I write simple code in python to just get a feel of how good the approximation could get, and this is what I found

*

*The plot is surprisingly looked linear, at least up to 27 (which is the highest I can go with my limited coding ability

*The equation for that linear extrapolation is $k = Mn$, where $k$ is the number of correct decimal place, and $n$ is the power. 

I have 2 question regarding this plot.

*

*Is it really close to linear, or is it just a coincidence because I work with small number.

*What is the value of $M$? So far, I only get like 0.53... And, is it rational?

 A: We can get a reasonable guess at what's going to happen just by the philosophy that probably writing $\pi$ as the $n^{\text{th}}$ root of an integer shouldn't be any more or less efficient at conveying the value of $\pi$ than just writing down the decimal digits. In other words, we can expect that writing down $\pi \approx \sqrt[27]{26\,487\,841\,119\,103}$ and $\pi \approx 3.141\,592\,653\,589\,793$ should be approximately equally accurate, because both of these have put in $16$ digits of effort into approximating $\pi$. (In this particular example, the $27^{\text{th}}$ root is only a tiny bit worse: it gets the $3$ at the end wrong.)
I'm actually not sure whether this intuition suggests counting the digits in "$27$" or not - if we don't count them, the $27^{\text{th}}$ root performs slightly better than the decimal expansion. Either way, that won't make a big difference, since $n$ is tiny compared to $\pi^n$.
If we believe this intuitive argument, then since the integer part of $\pi^n$ has about $$\log_{10}(\pi^n) = n \log_{10}\pi \approx 0.497 n$$ digits, it should correctly predict about $0.497n$ digits of $\pi$.

That's just intuition, not a proof. Here's an algebraic argument for the same estimate.
Suppose that we approximate $\pi$ as $\sqrt[n]{m}$, where $m$ is the closest integer to $\pi^n$. This guarantees to us that $|m - \pi^n| < \frac12$, and usually the error will be around $\frac14$. Let's write this as $$\left|\frac{m}{\pi^n} - 1\right| < \frac1{2\pi^n}.$$
To estimate the error, write $\pi = \sqrt[n]{m} + \delta$. Then $\frac{\sqrt[n]m}{\pi} = 1 - \frac{\delta}{\pi}$, or $\frac{m}{\pi^n} = (1 - \frac{\delta}{\pi})^n$. Substituting this into the inequality above, we get
$$
   \left|\left(1 - \frac{\delta}{\pi}\right)^n - 1\right| < \frac1{2\pi^n}.
$$
The linear approximation of $(1+x)^n$ is $1 + nx$, which has an $O(x^2)$ error as $x \to 0$; it is reasonable to use it here, since in fact $\frac{\delta}{\pi} \to 0$ as $n\to \infty$. This tells us that
$$
   \left|1 - \frac{n\delta}{\pi} - 1 \right| \lessapprox \frac1{2\pi^n}
$$
or $|\delta| \lessapprox \frac1{2n \pi^{n-1}}$.
We have $k$ correct digits when $|\delta| \approx 10^{-k}$, so in general the number of correct digits is about
$$-\log_{10} |\delta| \approx \log_{10} (2n\pi^{n-1}) = \log_{10}(\tfrac{2}{\pi} n) + n \log_{10}\pi.$$ This gives us a result very similar to the intuition we had: dropping the $\log_{10}(\frac2\pi n)$, which is a sublinear term, we predict about $0.497 n$ correct digits.

This assumes that we don't get much luckier in approximation of $\pi^n$ by an integer, which sometimes happens: for example, $\pi^3 \approx 31.006$, and as a result, $\sqrt[3]{31} \approx 3.14138$ gets us more correct digits than we expected. It could even be true (but I don't think there's any reason to suspect it) that $\pi^n$ regularly gets much closer than expected to an integer, which could upset the trend line. Both the intuition and the algebraic estimate above assume $\pi$ behaves like any other real number of about its size, which is probably true but hard to prove.
