For which numbers, every possible order can be achieved?

66 Views Asked by At

Let $n\ge 2$ be a natural number.

Then, every possible order of an number modulo $n$ is a divisor of $\lambda(n)$. $\lambda(n)$ is the Carmichael-function, it is the largest possible order modulo $n$.

Which numbers $n$ have the following property : For every $d|\lambda(n)$, except $d=1$, there is a number $a$ with $1<a<n$, such that the order of $a$ modulo $n$ is $d$ ?

Additionally : If we are looking for a number a with order $2$, for which $n$ can we avoid $a=n-1$, which is trivial ?

I experimented with PARI/GP and it seems that the desired property is fulfilled, if there is a number $a$ with order $\phi(n)$ modulo $n$.