# Find $a_{n+1}=\frac{a_n^2+1}{2}$ in terms of $n$.

I was trying to prove that for all $n\in \Bbb N$ there are integer numbers $\{a_1,a_2,\ldots,a_n,b_n\}$ s.t. $a_1^2+a_2^2+\dots+a_n^2=b_n^2$.
I founded that if $\{a_1,a_2,\ldots,a_n,b_n\}$ have the property then $\{a_1,a_2,\ldots,a_n,a_{n+1}=\dfrac{b_n^2-1}{2},b_{n+1}=\dfrac{b_n^2+1}{2}\}$ are the $n+1$ numbers which have the property too. I start with $a_1=b_1=3$ and get the sequence $3,4,12,84,\ldots$ and now try found $a_n$ in terms of $n$. I also prove that solving $b_{n+1}=\dfrac{b_n^2+1}{2},b_1=3$ is equivalent to solving $c_{n+1}=c_n^2+c_n+1 , c_1=1$. Thanks for reading the text and any helps.
NOTE: It's eaasy to check that for $b_1=3$ all $a_i$ and $b_i$ will be integer.

-
you just want to prove that sum of two squares is a a square.. Right? – Praphulla Koushik Nov 29 '13 at 16:53
oeis.org/A018930 or oeis.org/A127689 might be useful...Is $a_{n+1}>a_n$? – draks ... Nov 29 '13 at 16:57
At least you get some more values... – draks ... Nov 29 '13 at 17:02
The above two sequences have nothing to do with the question. This is the correct one: oeis.org/A127690 – Marek Nov 29 '13 at 17:05
To prove your initial question, we will use the fact that $3^2 + 4^2 = 5^2$ and proceed by induction. Suppose the statement is true for some $k$, then consider the $k+1$ numbers $$3a_1, 3a_2, \ldots 3a_k, 4b_k.$$ The square of sums is equal to $25 b_k^2$, or that $b_{k+1} = 5 b_k$. The closed form formula is $a_1 = 3^{n-1}, a_2 = 3^{n-2} \cdot 4, a_3 = 3^{n-3} \cdot 4 \cdot 5, \ldots a_n = 3^0 \cdot 4 \cdot 5^{n-1}$ and $b_n = 5^{n-1}$. – Calvin Lin Nov 29 '13 at 17:22

Let us tackle $c_{n+1} = c_n^2 + c_n + 1$

Set $x_n = c_n + \frac{1}{2}$.

We get

$$x_{n+1} = x_n^2 + \frac{5}{4}$$

This paper: http://www.fq.math.ca/Scanned/11-4/aho-a.pdf (see page 434) shows that $x_n$ is of the form: (nearest integer to $k^{2^n} + \frac{1}{2}$) - $\frac{1}{2}$ for all large enough $n$, for some constant $k$ (defined in terms of $x_n$ itself).

and thus $$c_n = \left\lceil k^{2^n} + \frac{1}{2} \right\rceil$$

It is unlikely you will get a "neater" closed form.

-
Finally I suggested that I shouldn't hope find very neat answer. So this is very neat for me. :) – Hoseyn Heydari Nov 29 '13 at 17:46