Set [tex] a^n=1+M[/tex]. Consequently [tex]a^n\equiv 1ModM[/tex] and is the smallest n for a>1, n>0. It also follows from the last equation that a belongs to the reduced residue group of order [tex]\phi{M}[/tex]. Consequently by LaGrange's Theorem, n is a divisor of the order of the group.

Set [tex] a^n=1+M[/tex]. Consequently [tex]a^n\equiv 1ModM[/tex] and is the smallest n for a>1, n>0. It also follows from the last equation that a belongs to the reduced residue group of order [tex]\phi{M}[/tex]. Consequently by LaGrange's Theorem, n is a divisor of the order of the group.

I can say what I meant for sure. However, the way I wrote it, "And is the smallest n for a>1,
n>0, which you have put in red, this, I see, is confusing. It is not what I am asserting, but is repeating the conditions given by xax, "As the title says, for any a>1 and n>0."

So that since n >0, and a>1, which is a very minimal restriction, we know we have a positive value here which I deliberately set: [tex] a^n=1+M[/tex] This is the smallest value of n which can be used to achieve the required non-trivial equation: [tex]a^n\equiv 1ModM[/tex] since the left side is, in fact, just 1 more than M.

What you have to do sometimes is look at problems. Say, 2^4 =16. So we set the modulus at 15. Thus we have 2^4 ==1 Mod 15.

Now phi(15)= phi(5)*phi(3) = 4x2 = 8. That means that the reduced residue group of elements relatively prime to 15 are 8 in number. They are the elements that form the multiplicative group. (3 for example is not in this group since there is no solution to 3X==1 Mod 15. So 3 has no inverse.)