Determine the number of integers $n$ with $1\leq n\leq 2017$ such that $323$ divides the expression $20^n + 16^n - 3^n - 1$.
So first, the expression is an even number (not sure what that does).
Then I try $323=20\times 16 + 3\times 1$ and so I get a $X = \frac{(20^n + 16^n)-(3^n+1)}{20\times 16} +3\times 1$ and then I don't know how to factor something out or something.
And so I try pressing some values in calculator and I see all even numbers for $n$ work so I get 1008, which is correct but how do I do this like logically?