title: Calculate discrete logarithm
body: <p>Given positive integers <code>b, c, m</code> where <code>(b &lt; m) is True</code> it is to find a positive integer <code>e</code> such that</p>
  
  <pre><code>(b**e % m == c) is True
  </code></pre>
  
  <p>where ** is exponentiation (e.g. in Ruby, Python or ^ in some other languages) and % is modulo operation. What is the most effective algorithm (with the lowest big-O complexity) to solve it?</p>
  
  <p>Example:</p>
  
  <p>Given b=5; c=8; m=13 this algorithm must find e=7 because 5**7%13 = 8</p>