Given:
The function has two integer parameters: k and n
The function returns the value of sum
function f(k, n) {
sum = 0;
for (i = 1; i ≤ n; i += 1) {
sum += i;
i *= k;
}
return sum;
}
Is there any mathematical formulae for this question??
