For how many integral value of $x\le{100}$ is $3^x-x^2$ divisible by $5$? For how many integral value of $x\le{100}$ is $3^x-x^2$ divisible by $5$?
I compared $3^x$ and $x^2$ in $\mod {5}$ i found some cycles but didn't get anything

HINT : For $n\in\mathbb N$,
$n$ can be divided by $5$ $\iff$ The right-most digit of $n$ is either $0$ or $5$.
You'll find some patterns in the followings from $x=1$ to $x=20$.
The right-most digit of $3^x$ : $3,9,7,1,3,9,7,1,3,9,7,1,3,9,7,1,3,9,7,1.$
The right-most digit of $x^2$ : $1,4,9,6,5,6,9,4,1,0,1,4,9,6,5,6,9,4,1,0.$
