var total = 0;
for (x = 1; x < 16; x++) {
var y = x + 1;
var singleSum = Math.pow(x, y) + Math.pow(y, x);
total = total + singleSum;
document.write(total + "<br>");
}
I want to take function(x,y) = x^y + y^x
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.