title: Generate random numbers with logarithmic distribution and custom slope
body: <p>Im trying to generate random integers with logarithmic distribution. I use the following formula:</p>
  
  <pre><code>idx = Math.floor(Math.log((Math.random() * Math.pow(2.0, max)) + 1.0) / Math.log(2.0));
  </code></pre>
  
  <p>This works well and produces sequence like this for 1000 iterations (each number represents how many times that index was generated):</p>
  
  <pre><code>[525, 261, 119, 45, 29, 13, 5, 1, 1, 1]
  </code></pre>
  
  <p><a href="https://jsfiddle.net/up53314u/">Fiddle</a></p>
  
  <p>I am now trying to adjust the slope of this distribution so it doesn't drop as quickly and produces something like:</p>
  
  <pre><code>[150, 120, 100, 80, 60, ...]
  </code></pre>
  
  <p>Blindly playing with coefficients didn't give me what I wanted. Any ideas how to achieve it?</p>