Series Calculation with a for Loop

Write a script file to compute the sum of the first 15 terms in the series 5k2 – 2k, k =
1.2.3….. ,5.


Because we know how many times we must evaluate the expression 5k2 – 2k. we can use a for loop. The script file is the following:


The answer is 5960.

Share This