Calculate variable based on remainder <p>How do I use JavaScript to calculate the <code>x</code> value in this formula?</p> <pre><code>(x * y) % z = 1 </code></pre> <p><code>y</code> and <code>z</code> are known integers.</p> <p>For example, <code>y = 7</code>, <code>z = 20</code>. 3 multiplied by 7 results into 21, that divided by 20 results into remainder of 1. Solution <code>x = 3</code>.</p> <p>(3 * 7) % 20 = 1</p>