Started an introductory number theory class and totally stuck on some homework after hours of effort. Feel like I'm so close but can't do the final bit to solve it and starting to wonder if my approach is wrong.
Question: $p$ is an odd prime, $a$ is a primitive root mod $p$, and $k$ is an integer.
I'm trying to show that $(a+pk)^{p-1}≡1+ph−pka^{p−2} \mod{p^2}$, for some $h∈\mathbb{Z}$; then that if $k≢ah \mod{p}$, then $a+pk$ is a primitive root mod $p^2$.
What I've done: I've made some progress by showing that the order of $(a+pk) \mod{p^2}$ is either $p-1$ or $p(p-1)$. After that, the first part of the problem is straightforward if the order is $p-1$ ($h=ka^{p−2}$).
But, if the order is $p(p-1)$, I can use the binomial to get to $(a+pk)^{p-1}≡a^{p−1} - pka^{p-2} \mod{p^2}$. Getting close to what I have to show but not sure where to go from there.
For the second part of the problem, it's a similar issue. I can get to $(a+pk)^{p-1}≢ 1+ph-pha^{p-1} \mod{p^2}$.
Then of course if $a^{p-1} ≡ 1\mod{p^2}$, then $(a+pk)^{p-1}≢ 1 \mod{p^2}$, and $(a+pk)$ is a primitive root since it can only have order of $p-1$ or $p(p-1)$.
But if the order of $a$ is $p(p-1)$ instead, I don't know where to go from there.
I already managed to get the step in the duplicate question, what I can't understand is how you got to the step in your comment. Isn't that contingent on $a^{p-1} ≡ 1\mod{p^2}$? But the order of $a$ could be $p(p-1)$ instead.
– Wesley Jan 22 '23 at 00:45