Problem

Source: 2018 JBMO TST - Turkey, P5

Tags: NumberTheory



Let $a_1, a_2, ... , a_{1000}$ be a sequence of integers such that $a_1=3, a_2=7$ and for all $n=2, 3, ... , 999$ $a_{n+1}-a_n=4(a_1+a_2)(a_2+a_3) ... (a_{n-1}+a_n)$. Find the number of indices $1\leq n\leq 1000$ for which $a_n+2018$ is a perfect square.