Problem

Source: KJMO 2023 P3

Tags: number theory, Sequence



Positive integers $a_1, a_2, \dots, a_{2023}$ satisfy the following conditions. $a_1 = 5, a_2 = 25$ $a_{n + 2} = 7a_{n+1}-a_n-6$ for each $n = 1, 2, \dots, 2021$ Prove that there exist integers $x, y$ such that $a_{2023} = x^2 + y^2.$