Mathematics Stack Exchange is a question and answer site for people studying math at any level and professionals in related fields. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

If values $a$, $b$, and $c$ are known, is there an efficient way to find $x$ in the equation: $a^{x} \bmod b = c$?

E.g. finding $x$ in $128^{x}\bmod 209 = 39$.

share|cite|improve this question
up vote 5 down vote accepted

This is the Discrete Logarithm Problem. If by "efficient" you mean "polynomial time general purpose algorithm", the answer is that none are known.

share|cite|improve this answer

A better reference than Wikipedia for the discrete logarithm problem is Andrew Sutherland's 2007 MIT Thesis Order Computations in Generic Groups. Here's an excerpt from p. 14 that provides a concise summary of the current state of knowledge.

enter image description here
enter image description here

share|cite|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.