for $(a,b)=1$, $a^n$ to $a^{n+b-1}$ modulo $b$ is a complete system of residues of $b$ (except for the remainder 0) Is this right?

16 Views Asked by At

I had a discovery which,

For $(a,b)=1$, $a^n$ to $a^{n+b-1}$ modulo $b$ is a complete system of residues of $b$ (except for the remainder 0)

Such as, when $(a,b)=(6,17)$, the remainders are $\{6,2,12,4,7,8,14,16,11,15,5,13,10,9,3,1,6,\ldots\}$.

Such as, when $(a,b)=(3,7)$, the remainders are $\{3,2,6,4,5,1,3\}$.

However when $a$ is a square number(or perhaps, cubic number, and so on) the conclusion above won’t work.

Such as, when $(a,b)=(4,7)$, the remainders are $\{4,9,1,4\}$

Such as when $(a,b)=(8,13)$, the remainders are $\{8,12,5,1,8\}$

Is this speculation correct? Is there a theorem for this? Most importantly, how to prove this? Or how is it wrong?

Any help or correction is appreciated. Thank you very much.