title: Index into the "fraction table" and back
body: <p>Suppose the following array of fractions:</p>
  <pre><code>1/2, 1/3, 2/3, 1/4, 2/4, 3/4, 1/5, 2/5, 3/5, 4/5, 1/6, ...
  </code></pre>
  <p>Creating an array like this is pretty trivial:</p>
  <pre class="lang-js prettyprint-override"><code>for (var i = 2; i &lt; 100: i ++) {
     for (var j = 1; j &lt; i; j ++) {
        console.log(j / i);
     }
  }
  </code></pre>
  <p>I would like to transform an &quot;index&quot; to this array into a floating point number, <strong>without using a lookup table</strong>, such that:</p>
  <ul>
  <li>0 = 0.5</li>
  <li>6 = 0.125</li>
  <li>10 = 0.833</li>
  </ul>