Vasya chose a certain number $x$ and calculated the following: $a_1=1+x^2+x^3, a_2=1+x^3+x^4, a_3=1+x^4+x^5, ..., a_n=1+x^{n+1}+x^{n+2} ,...$ It turned out that $a_2^2 = a_1a_3$. Prove that for all $n\ge 3$, the equality $a_n^2 = a_{n-1}a_{n+1}$ holds.