Assume we have a function $f(x)=x^2+1$ and I iterate the function so that $f^n(x)=(f^{n-1})^2 +1$. I was able to generalize that the number of terms $n$ after some number $k$ iterations is $n=\frac{2^k+2}{2}$
I need to prove this somehow, and I think mathematical induction is the way to go. I found the base case and the $P_k$ case. However, I am not sure how to approach $P_{k+1}$ and find an expression that would clearly show that this property is true.