summing exponents in javascript
<pre><code>var total = 0;
for (x = 1; x &lt; 16; x++) {
    var y = x + 1;
    var singleSum = Math.pow(x, y) + Math.pow(y, x);
    total = total + singleSum;
    document.write(total + "&lt;br&gt;");
}
</code></pre>

<p>I want to take <code>function(x,y) = x^y + y^x</code> where x starts at 1 and y starts at 2 then find the sum of the first 15 function calls. I can't figure out what I'm doing wrong. Any help would be appreciated. Thanks.</p>
