If I know the smallest positive $n$ such that $10^n \equiv 1 \pmod{p}$ for $p$ prime, then am I able to find the smallest positive $n'$ such that $10^{n'} \equiv 1 \pmod{p^2}$ and so on. I believe so, and it goes as follows.
$n' = pn \\ n'' = p^2 n \\ \vdots \\ n^{(k)} = p^k n$
I've tested it for a few $p$ and it seems to work, but I can't get a proof of it together. Any help would be greatly appeciated!
This is not true in general. Exceptions modulo $p^2$ are called "base-10 Wieferich primes", and there are three known, namely 3, 487, and 56598313—although there are conjectured to be infinitely many.