The question concerns the multiplicative order $ord_{a}(k)$ if $gcd (a, k) > 1$.
$2^{0} \pmod 4 = 1$
$2^{1} \pmod 4 = 0$
$2^{2} \pmod 4 = 0$
$2^{3} \pmod 4 = 0$
$2^{4} \pmod 4 = 0$
...
$4^{0} \pmod 6 = 1$
$4^{1} \pmod 6 = 4$
$4^{2} \pmod 6 = 4$
$4^{3} \pmod 6 = 4$
$4^{4} \pmod 6 = 4$
...
Is there always an $x$ such that $k^{x} \pmod a = k^{x+1} \pmod a$?
What is the maximum value (minimum correct $x$) of which can take $x$ for defined data $a$ and $k$?
If $x$ exists so that
$$k^x \equiv k^{x + 1} \pmod{a}$$
then we have
$$a | k^x (k - 1)$$
This motivates the counterexample $a = 6, k = 2$ for the first question.