This can be calculated in R using a custom function as follows:
Click to show/hide code
# Option 1sum_series1 <-function(n) { # create a function with n as an argumentsum(4*(1:n)-3) # calculate the sum of the series 4i-3 from 1 to n}sum_series1(4)
[1] 28
Click to show/hide code
# Option 2sum_series2 <-function(n) { # create a function with n as an argument sum_n <-0# create an empty variable to store the sum with 0 as an initial valuefor (i in1:n) { # set for loop to iterate from 1 to n sum_n <- sum_n +4*i-3# add the value of 4i-3 to the sum_n variable }return(sum_n) # return the final value of sum_n}sum_series2(4)
The summation index is \(i\), so its value changes as summation progresses but the value of \(a\) remains constant.
2 Common properties of summation notation
\(\displaystyle \sum_{i=i_0}^{n} ca_i = c \displaystyle \sum_{i=i_0}^{n} a_i\), where \(i_0\) is the lower limit, \(n\) is the upper limit, and \(c\) is a constant
\(\displaystyle \sum_{i=i_0}^{n} a_i = \displaystyle \sum_{i=i_0}^{m} a_i + \displaystyle \sum_{i=m+1}^{n} a_i\), where \(m\) is any integer between \(i_0\) and \(n\)