Proving a number defined by a sequence is a square number

Solution 1:

This may be a little brute force, but it's a solution:

If you're familiar with solving linear recurrences, you'll know that you can write a formula for the $x_n$ of the form $$x_n = A\lambda_+^n + B\lambda_-^n,$$ where $A$ and $B$ are constants and the $\lambda_\pm$ are the roots of the polynomial $x^2 + x + 2$, that is, $$\lambda_\pm = \frac{-1 \pm i\sqrt{7}}{2}.$$ Using the initial conditions $x_0 = 0$ and $x_1 = 1$, you can solve for the constants $A$ and $B$:$$ A = -B = \frac{-i}{\sqrt{7}}.$$ This then gives the explicit formula for the $x_n$:$$ x_n = \frac{-i}{\sqrt{7}}(\lambda_+^n - \lambda_-^n).$$ Now one has $$s_n = 2^{n+1} - 7x_{n-1}^2 = 2^{n+1} + (\lambda_+^{n-1} - \lambda_-^{n-1})^2 = 2^{n+1} + \lambda_+^{2(n-1)} + \lambda_-^{2(n-1)} - 2(\lambda_+\lambda_-)^{n-1}.$$ Using the fact that $\lambda_+\lambda_- = 2$, this becomes $$s_n = \lambda_+^{2(n-1)} + \lambda_-^{2(n-1)} + 2^n.$$ But then we can use $\lambda_+\lambda_- = 2$ again to write $$s_n = \lambda_+^{2(n-1)} + \lambda_-^{2(n-1)} + 2(\lambda_+\lambda_-)^{n-1} = (\lambda_+^{n-1} + \lambda_-^{n-1})^2.$$ Now it only remains to show that $\lambda_+^{n-1} + \lambda_-^{n-1}$ is an integer. Define $\alpha_n = \lambda_+^n + \lambda_-^n$ for each $n$. Then $\alpha_0 = 2$, $\alpha_1 = -1$, and $\alpha_{n+2} + \alpha_{n+1} + 2\alpha_n = 0$ for each $n\geq 2$, so $\alpha_n$ is an integer for all $n$. This completes the proof.