Equations system from a contest Let $n$ be a positive integer. Find all the real solutions $a_1,a_2,\dots,a_n $  such that
$$a_1^2+a_1-1=a_2$$
$$a_2^2+a_2-1=a_3$$
$$a_3^2+a_3-1=a_4$$
$$\dots$$
$$a_{n-2}^2+a_{n-2}-1=a_{n-1}$$
$$a_{n-1}^2+a_{n-1}-1=a_n$$
$$a_{n}^2+a_{n}-1=a_1$$
My attempt:
Since it's a problem from a contest I tried just adding everything but the only thing I get is
$$a_1^2+\dots a_n^2=n$$
Also I tried to use the AM-GM inequality, but I didn't get anything from it more than $1\geq \sqrt[n]{a_1^2a_2^2\dots a_n^2}$.
But none is helpful to solve it. Any suggestion?
 A: The solution was almost there.
First, notice that it always happen that $a_i\neq 0$, or the equations won't have sense.
You just need to re-write each equation and get $a_i^2+a_i=a_{i+1}+1$ that in factors would be $a_i(a_i+1)=a_{i+1}+1$.
Since you need to have a product of the $a_i$'s to make use of the $n$-th root you got, just multiply all the equations, and you get
$$a_1a_2\dots a_n(a_1+1)(a_2+1)(\dots)(a_n+1)=(a_1+1)(a_2+1)(\dots)(a_n+1)$$
Now, if none of the sides is zero (that means $a_i=-1$ for at least one of the values), you see that $\prod a_i=1$, and then $\prod a_i^2=1$.
Using this in your inequality, you have that $1\geq 1$, but also you know that the AM-GM inequality is an equality if and only if $a_i=a_j$ for all the $i,j$.
So check what happens when $a_i=a_{i+1}$, and you get that $a_i^2=1$, so (being all the $a_i$'s equal) $a_i=\pm 1$.
The case $a_i=-1$ we avoided when dividing in the equation is not a problem since we can consider this case just evaluating $a_i=-1$ and you will see that again you get all the values equal to $-1$ like in the first part.
So the only solutions found are $a_1=a_2=\dots=a_n=\pm1$.
