<s>[INST] Find all integers $k$ such that $5^k\equiv 97 \pmod{101}$ Find integers $k$ such that $5^k\equiv 97 \pmod{101}$.
By brutal force, If $k=23$ then $101\vert 5^{23}-97$. Furthermore, by Euler-Fermat theorem, since $gcd(5,101)$ we have, $5^{100}\equiv 1\pmod{101}$, then for integer $r$, $5^{100r}\equiv 1\pmod{101}$, so $5^{100r+23}\equiv 97\pmod{101}$, but I'm not sure if this is true, any other idea of how find all intergers k. Thanks!
 [/INST] $97 \equiv -4 \mod 101$.  $-4 * 25 = -100 \equiv 1 \mod 101$.
So if $5^k \equiv 1 \mod 101$ then $5^{k -2} \equiv 97 \mod 101$.
Now $5^{100} \equiv 1 \mod 101$ as 101 is prime so $\phi (101) = 100$ so $5^{\phi(101)} \equiv 1 \mod 101$.
$5^{100} \equiv 1 \mod 101$.  So try $5^{50}$ and $5^{25}$ and we see $5^{25} \equiv 1 \mod 101$.  If there is any smaller power so that $5^n \equiv 1 \mod 101$ it would be $5$.  But $5^5 \equiv 95 \equiv -6 \mod 101$.
So $5^{25} \equiv 1 \mod 101$ so $5^{25-2} = 5^{23} \equiv 97 \mod 101$.
so $k = 25r + 23$ are all the integers such that $5^k \equiv 97 \mod 101$.
</s>