Prove that there are infinitely many $n$ such that $2018 \mid U_n-1$
Given $U_1=5, U_2=7, U_3=107$.
and $U_{n+2}=U_n(U_{n+1}+2)+U_{n-1}(U_n+1), \forall n\ge 2$
Prove that there are infinitely many integers such that $2018 \mid U_n-1$
Because this is a very lengthy and confusing problem, I don't really know where to start. The only things I have been thinking of is $2018=2 \times 1009$, and since the problem also implies all the numbers in the sequence are odd, we literally only have to find numbers that leave a remainder of $1$ when divided by $1009$.
The next thing I'm thinking of is proving that the remainder sequence repeats, which means the remainder sequence should go like this:
\begin{align} 5,7,107, \cdots, 5,7,107, \cdots, 5,7,107, \cdots, \end{align}
I knew how to do it with the second-degree recursive sequences: by using the Pigeonhole principle for couples of $(U_n, U_{n+1})$, but I don't think that applies to third-degree recursive sequences like this.
And I still don't know if there's a number that $\equiv 1 (\mod 1009)$
Any help is appreciated!
The following proof explains Apass.Jack's comment a little bit more explicitely.
For all $n\in \mathbb N$ let $\overline {U}_n:=\varphi(U_n)$, where $\varphi\colon \mathbb Z\to \mathbb Z/1009\mathbb Z$ maps every integer to its congruence class modulo 1009.
Claim. If we can find $N,p\in\mathbb N$ with $$\tag{1}(\overline{U}_N,\overline{U}_{N+1},\overline{U}_{N+2})=(\overline{U}_{N+p},\overline{U}_{N+p+1},\overline{U}_{N+p+2}),$$ then for every integer $n\geq N$ holds $\overline{U}_n=\overline{U}_{n+p}.$
Proof. This can easily be proven by induction. For $n\in\{N,N+1,N+2\}$ the statement is true because of $(1)$. Now let $n> N+2$ and assume we have $\overline{U}_{m}=\overline{U}_{m+p}$ for all $m$ with $N\leq m< n$. We get \begin{align*}\overline{U}_{n} &= \overline{U}_{n-2}(\overline{U}_{n-1}+2)+\overline{U}_{n-3}(\overline{U}_{n-2}+1)\\&=\overline{U}_{n+p-2}(\overline{U}_{n+p-1}+2)+\overline{U}_{n+p-3}(\overline{U}_{n+p-2}+1)\\\tag{$\square$} &=\overline{U}_{n+p} \end{align*} Then I guess Apass.Jack wrote a program and got $N=910$, $p=1622$ and $\overline{U}_{1849}=1$.