I was trying to solve the following recurrence relation using method of generating function but I couldn't.
$$a_n=a_{n-1}^2-a_{n-1} +1$$ for $a_0=2$ and $n>0$.
After googling I found it is the recurrence for Sylvester's sequence (A000058 OEIS).
In wikipedia the $n^{th}$ term of sequence is given by $$a_n=\lfloor E^{2^{n+1}}+\frac{1}{2}\rfloor$$ where $E=1.264084735305302$ approximately.
So my questions are
a) Whether the above has a perfect closed form solution or not ?
b) If yes, is $E$ rational or irrational ?
c) Is there a way to tell if the given recurrence relation having quadratic form($a_n=pa_{n-1}^2+qa_{n-1} +r$) has closed form solution just by looking at the coefficients ?