- #106

Well, per assumption [itex]n\mid q^{\phi (n)}-1[/itex]. Thus the set [itex]\{x : n\mid q^x -1\}\subset \mathbb N[/itex] is non-empty, therefore there is smallest one.

Where did you (implicitely) use that ##(q,n)=1##? And that does not solve the problem entirely of course.