The sum S of positive even integers starting from 2 to n (even) is described as :
S = 2 + 4 + 6 + 8 +… n where the last element n is even.
Questions:
n = 1; f(n) = 2 = 1 + 1^2
n = 2; f(n) = 6 = 2 + 2^2
n = 3' f(n) = 12 = 3 + 3^2
n = 4; f(n) = 20 = 4 + 4^2
...
So general formula is f(n) = n + n^2
Sum with n = 5298 is therefore 28,074,102
Oh wait, maybe I haven't quite got this right. My n is the number in the sequence. If the n in the question refers to the actual even integer, then I would have to divide this by 2 to get the position in the sequence. In that case, the answer would be 7,019,850, as 5298 is the 2649th number in the sequence of even integers >0. In this case I concur with Gaetano.
f(n=2m) = S = 2+4+6+ ... +2m // by definition of f and change of variable, n= 2m
= 2*(1 + 2 + 3 + ... + m) // common factor of 2
= 2(m*(m+1)/2) // by sum of the m first integers
= m(m+1) // simplification
= (n/2)((n/2)+1) // by our definition of m
f(5298) = f( 2* 2649) = 2649*2650 = 7 019 850
<NOPE, I BELIEVE THIS IS INCORRECT. I need to go back and spend more time on this.>
I'm noticing that the total given any n, call it T(n), is just n(n+1) as per below...
n | 1 | 2 | 3 | 4 | 5 |
2n | 2 | 4 | 6 | 8 | 10 |
T(n) | 2 | 6 | 12 | 20 | 30 |
n(n+1) | 2 | 6 | 12 | 20 | 30 |
So, the formula is T(n) = n * (n+1)
For n = 5298, T(n) = 5298 * 5299 = 28,074,102
Not very scientific but I think it's correct.
n=5298 ==> sum is 7019850