So I have this problem, $W=3^n -n -1$. How to find all $n$ so $W$ can be divided by $5$.
what I tried: I found all the remainders of $3^n$ divided by $5$, they are: $1,3,4,2$.
if there isn't ($-n$), it's easy but with it I can't continue.
this is the solutions of the problem: $n=20k+11$, $n=20k+18$, $n=20k+17$, $n=20k$. but I don't know how to find them
thanks