I have to prove the following lemma: let $p$ prime number, $n \in \mathbb{N}_{>1}$ and $a \in \mathbb{Z}$ s.t. $a^p \equiv 1$ modulo $p^n$, thus we have the following cases
1) if $p$ is odd then $a \equiv 1$ mod $p^{n-1}$;
2)if $p=2$ then $a \equiv \pm1$ mod $2^{n-1}$.
I'm given the hint to use Fermat little theorem to prove the equality $a=1+kp^d$ where $p$ doesn't divide $k$ and $d>0$: to prove this formula is very easy but I don't understand how to use it to get the final result in the firts case.
I dealt 2) in the following way: knowing $a=1+k2^d$ we have $ a^2=1+k2^{d+1}+k^2 2^{2d} $ and imposing the condition $a^2 \equiv 1$ mod $2^n$ I can get the result after various computations (here I omit them since they are trivial).
The problem is that I'm not sure this method works even for $p$ odd: I get by the usual formula $a^p=(1+kp^d)^p= 1+\binom{p}{1}kp^d+\dots + (kp^d)^p$ so I have to impose $\binom{p}{1}kp^d+ \binom{p}{2}k^2p^{2d}+\dots + (kp^d)^p\equiv 0$ mod $p^n$ but I don't get how this condition implies $d\geq n-1$.
Surely the point is that either my approach is not effective and I have to find another method or I'm passing over some basic number theory fact that would lead me to the conclusion.
Any help or advice is welcome.