TITLE: number coefficients of an infinite root of 2
QUESTION [6 upvotes]: Today I stumbled upon one of Ramanujan's infinite roots with all the integers and that got me curious so I started to try to create one of my own. I started with $2=2$. Then $$2=\sqrt4$$ Then $$2=\sqrt{1+3}$$ Then $$2=\sqrt{1+\sqrt{9}}$$ Then $$2=\sqrt{1+\sqrt{2+7}}$$ Then $$2=\sqrt{1+\sqrt{2+\sqrt{3+46}}}$$ Then $$2=\sqrt{1+\sqrt{2+\sqrt{3+\sqrt{4+2112}}}}$$ Then the final step I did was $$2=\sqrt{1+\sqrt{2+\sqrt{3+\sqrt{4+\sqrt{5+4460539}}}}}$$ Each step did equal 2 and while doing this I got very curious at to the numbers that were following each of the counting numbers in each step. By this I mean $$3$$ in $$1+3$$ and the $$7$$ in $$2+7$$ as well as the $$46,2112,$$and$$4460539$$ After trying for a long time, I failed to create a function that would give out these values when putting in $$1,2,3,4...$$ Which is why I have come here. This is purely for curiosity, but I need help to create a function that will spit out $$3,7,46,2112,4460539,..etc$$. Thanks!

REPLY [2 votes]: Based on what you were doing, there's a clear recursion:
$$f(n) = f(n - 1)² - n$$
This is a nonhomogenous quadratic map and likely has no closed form solution. I would say you should be ready for the possibility that no "plug and play" function exists. I can work on any other type of solution for this, we'll see if anything comes up.