I am puzzled with the following discrete logarithm problem:


Given positive integers `b, c, m` where `(b < m) is True` it is to find a positive integer `e` such that



```
(b**e % m == c) is True

```

where two stars is exponentiation (e.g. in Ruby, Python or ^ in some other languages) and % is modulo operation. Using general math symbols it looks like:($b^e \equiv c (\mod m)$). 


What is the most effective algorithm (with the lowest big-O complexity) to solve it ?


Example:
Given b=5; c=8; m=13 this algorithm must find e=7 because 5\*\*7%13 = 8


Thank you in advance!



The Discrete Logarithm problem
The question is not phrased to our taste at mathoverflow, but the user has a point that this particular Wikipedia page is under-developed. As David Speyer suggests, it is a very different problem for very large primes than for small ones. For small primes the simplest algorithms described in Wikipedia are probably the most appropriate. If the question is instead about the theoretical time complexity, see [this review article](http://www.math.leidenuniv.nl/~psh/ANTproc/12oliver.pdf).


