$x^4 + 1020x^3 - 4x^2 + 2039x+1$ is divisible by 1019. Give all integers x in the range [1,2018] such that $x^4 + 1020x^3 - 4x^2 + 2039x+1$
is divisible by 1019.
Applying mod 1019 to the coefficients, we have
$x^4 + x^3 - 4x^2 + x + 1$ which is equal to $(x-1)^2(x^2+3x+1)$
I tried making 1 of the factors equal to a multiple of 1019, but it looks tedious and i have not found a solution other than 1020.
answer given : 1, 492, 524, 1010, 1511, 1543

$(x-1)^2(x^2+3x+1)\equiv0\bmod1019\implies$
$ x-1\equiv0\bmod1019$ or $x^2+3x+1\equiv0\bmod1019$.  
The former implies $x\equiv1\bmod 1019$; solutions in $[1,2018]$ are $1$ and $1020$.
The latter implies $x^2+3x+\dfrac94\equiv\dfrac94-1\bmod1019$, so $\left(x+\dfrac32\right)^2\equiv9\times255-1\equiv256\bmod1019$,
so $x+\dfrac32\equiv\pm16,$ so $x\equiv\pm16-3(510)\equiv492 $ or $524$;
solutions in $[1,2018]$ are $492, 524, 1511$ and $1543$.
