I came up with a formula for finding the next perfect square with a given square. The formula is written as follows:
$$y = p + \left(1 + 2\sqrt{p}\right)$$
where $p$ is the given square or past result.
This can also be put as
$$y_n = y_{n-1} + \left(1 + 2\sqrt{y_{n-1}}\right)$$
If you put in the number $9$, it shows up as this:
$$\begin{align} y &= 9 + \left(1 + 2\sqrt{9}\right)\\[4pt] y &= 16 \end{align}$$
Every number I plugged in gave me the next square, and even with decimals, it gave me a correct answer. This left me wondering if it will always work.
I would also like to ask if it already exists. I looked up this formula, but I didn’t find it anywhere, so I’m not sure if someone already came up with it.
