First addressing why it is useful, well, first it's a good party trick with a basic calculator without a $x^y$ button.
Alice: "If a calculator only has $\sqrt{}$, some numbers, and multiplication, what can you compute or approximate?"
Bob: "Obviously, the square root and multiplication"
Alice: "What if I can estimate the cube root of any number that you give to me? "
Bob:" Is it some sort of binary search, that is trivial isn't it?"
and then Alice gets to perform this trick. What is even cooler is
In theory, it is possible to approximate any real root using a calculator with a square root key.
Alright, now, going on to the maths:
Starting from $x_1=r$,
Define:
$$x_{k+1} =(x_k+1)r$$
We can easily prove by induction that this is just a geometric series with the first term being $r$ and common ratio $r$,$$x_{k+1}= \sum_{i=1}^{k+1}r^i=\frac{r(1-r^{k+1})}{1-r}$$
Hence as $k \to \infty$, if $|r|<1, r \ne 0$, $$x_{k+1} \to \frac{r}{1-r}=\frac{1}{\frac1r-1}$$
If we pick $r= \frac14$, then the sequence converges to $\frac1{4-1}=\frac13$.
If we pick $r = \frac1{2^n}$, then the sequence converges to $\frac1{2^n-1}$
and we have $y^{x_k} \to y^{(\frac1r-1)^{-1}}.$ If we pick $r = \frac14$, then $y^{x_k} \to y^\frac13$.
Taking square root twice means $\frac14$ at the power indices and multiply by itself once means plus $1$ in the power index.
Comments about your program:
- There isn't a need to store every single values in a matrix if the purpose is just to print it.
- In the presence of a well established approximated solution, rather than asking for maximum number of iterations, perhaps just ask for the error tolerance and use a while loop to terminate when the error tolerance is satisfied.
Comments on comparison between bisection and this method:
For binary search that begins with interval length $1$: to shrink it up to $10^{-8}$. We need $8\log_2 10 \approx 26.5$ steps.
For this method.
Note that $x_k$ increases.
We want $$57^\frac13-57^{x_k}< \epsilon$$
$$\log_{57}(57^\frac13 - \epsilon) <{x_k}$$
$$ \frac{r}{1-r}(1-r^k)> \log_{57}(57^\frac13 - \epsilon)$$
$$r^k < 1- 3\log_{57}(57^\frac13 - \epsilon)$$
$$4^k > \frac{1}{ 1- 3\log_{57}(57^\frac13 - \epsilon)}$$
$$k > - \log_4 ( 1- 3\log_{57}(57^\frac13 - \epsilon))$$
From the computation $k$ needs to be at least $15$ which is reflected in your computation.
This method is faster when
$$-\log_4 ( 1- 3 \log_y ( y^{\frac13}-\epsilon) < - \log_2 \epsilon$$
$$ 1- 3 \log_y ( y^{\frac13}-\epsilon) > \epsilon^2$$
$$ \frac{1- \epsilon^2}3 > \log_y ( y^{\frac13}-\epsilon) $$
$$ y^{\frac13} - y^{\frac{1-\epsilon^2}3}< \epsilon$$