(This goes for all of this code.) You can simplify the code significantly by making use of the functions in [underscore.js](http://underscorejs.org/). Here's a sample of how you could have defined the same vars with much less code duplication:

```html
<div class="vars">
    <var id="N">randRange(2, 3)</var>
    <var id="LETTERS">['x', 'y', 'z'].slice(0, N)</var>
    <var id="INTEGERS">_.map(LETTERS, function() {
        return randRangeWeighted(-3, 3, 0, 0.5);
    })</var>
    <var id="DIGITS">_.map(LETTERS, function() {
        return randRange(1, 2);
    })</var>
    <var id="REPEATS">_.map(DIGITS, function(digit) {
        return digit === 1 ? randRange(1, 8) : randRange(10, 98);
    })</var>
    <var id="DENOMINATORS">_.map(DIGITS, function(digit) {
        return pow(10, digit) - 1;
    })</var>
    </var>
    <var id="NUMERATORS">_.map(LETTERS, function(letter, i) {
        return INTEGERS[i] * DENOMINATORS[i] +
                REPEATS[i] * (INTEGERS[i] &lt; 0 ? -1 : 1);
    })</var>
    <var id="NUMERATORS">_.map(DECIMALS, function(letter, i) {
        return INTEGERS[i] + (INTEGERS[i] &lt; 0 ? -1 : 1) *
                REPEATS[i] / DENOMINATORS[i],
    })</var>
    <var id="NUMERATOR">_.reduce(NUMERATORS, function(x, y) { return x * y; }, 1)</var>
    <var id="DENOMINATOR">_.reduce(DENOMINATORS, function(x, y) { return x * y; }, 1)</var>
    <var id="GCD">getGCD(NUMERATOR, DENOMINATOR)</var>
</div>
```