Problem

Source: Swiss MO 2023/3

Tags: number theory, greatest common divisor



Let $x,y$ and $a_0, a_1, a_2, \cdots $ be integers satisfying $a_0 = a_1 = 0$, and $$a_{n+2} = xa_{n+1}+ya_n+1$$for all integers $n \geq 0$. Let $p$ be any prime number. Show that $\gcd(a_p,a_{p+1})$ is either equal to $1$ or greater than $\sqrt{p}$.