3

Is there any known method for calculating $\lambda_a(n)$ which returns the smallest integer $m$ such that $a^m\equiv 1 \pmod n$ where $\gcd(a,n)=1$ ?

I searched but I found nothing, is there at least an algorithm that does not use bruteforce ?

Note : as you may note this is closely related to Carmichael function, the difference is that $a$ is fixed here.

  • @MichaelBurr thanks, I fixed it. –  Aug 30 '15 at 23:51
  • Depends on how large $n$ is. If we can factor $\lambda(n)$, we can start with that, and calculate $a^{\lambda(n)/p}$ modulo $n$ for the various prime factors of $\lambda(n)$. As long as we get $1$, keep descending. – André Nicolas Aug 30 '15 at 23:59
  • This is an instance of the discrete logarithm. Suffice it to say that finding a discrete logarithm is hard, in the sense that there is no classical algorithm that runs in polynomial time. https://en.wikipedia.org/wiki/Discrete_logarithm#Algorithms – 727 Aug 31 '15 at 00:10
  • I'm not looking for a really fast algorithm, just better than trying all $m$ or as I found out trying divisors of $\phi(n)$. –  Aug 31 '15 at 00:14

1 Answers1

1

What you're asking for is known as the order of $a$ modulo $n$. The strongest result I know of is that $\text{ord}_n a\mid \phi(n)$.

Samir Khan
  • 2,440
  • 13
  • 19