Suppose $a_1, a_2, \ldots$ is a sequence of integers, and $d$ is some integer. For all natural numbers $n$, \begin{align*}\text{(i)} |a_n| \text{ is prime;} && \text{(ii)} a_{n+2} = a_{n+1} + a_n + d. \end{align*}Show that the sequence is constant.
Source: Philippines MO 2018/2
Tags: number theory
Suppose $a_1, a_2, \ldots$ is a sequence of integers, and $d$ is some integer. For all natural numbers $n$, \begin{align*}\text{(i)} |a_n| \text{ is prime;} && \text{(ii)} a_{n+2} = a_{n+1} + a_n + d. \end{align*}Show that the sequence is constant.