<script> function a(n,x) { for (var i = 0; i< n; ){ x = x * 1.3 + 300 * ++i; } return x } ; for (var i=0; i<10; i++) {document.write(i + " = " +a(i,100)+ "<br>")} </script>