Let sequence $(a_{n}): 0,1,1,2,2,3,3,4,4,....,k,k,k+1,k+1,.....$. Compute the sum $S_{n}=a_{1}+a_{2}+.....+a_{n}$.
\[n(n+1)\times\frac{1}{2}\times 2\]
isn't this just twice the sum of a simple arithmetic progression: 1, 2, 3, 4, ..., n?
if you were adding up from 1 to 2n
oh yes, so its twice the sum of: 1, 2, 3, ..., n/2
it is thrown off a little since the first value is 0
but the zero seems to be ignored because it says S = a(1) + a(2) + ...
is \[a_1\text{ or }a_0\] the first term?
\[a_1\]I see what you are saying now, so a1 IS zero
that's what I think
so my guess is the sum will involve some mod operators to check for odd/even n?
yes
ok, so taking @Zarkon's advice, here is my attempt at this: if n is odd, then there are (n+1)/2 terms starting with 0 and (n-1)/2 terms starting with 1. so we get the Odd N Sum (ONS) as:\[ONS_n=\frac{n+1}{4}(0+(\frac{n+1}{2}-1))+\frac{n-1}{4}(2+(\frac{n-1}{2}-1))\]\[=\frac{n^2-1}{8}\] if n is even, then there are n/2 terms starting with 0 and n/2 terms starting with 1. so we get the Even N Sum (ENS) as:\[ENS_n=\frac{n}{4}(0+(\frac{n}{2}-1))+\frac{n}{4}(2+(\frac{n}{2}-1))\]\[=\frac{n^2}{4}\] so: n MOD 2 == 0 ==> S_n = ESN_n = n^2/4 n MOD 2 != 0 ==> S_n = ONS_n = (n^2-1)/8
these all make use of the sum of an arithmetic progression to 'n' terms where the difference between each term is 'd' and the first term is 'a' being:\[S_n=\frac{n}{2}(2a+(n-1)d)\]in this case 'd' is 1 for both sequences and the first term 'a' is 0 for one sequence and 1 for the other.
sorry I wrote the sum for Odd 'n' incorrectly, it be (n^2-1)/4 I guess we could simplify it further by writing the sum as: S_n = (n^2 - (n MOD 2))/4 which takes care of the odd/even nature of 'n'.
does anyone know of how to enter MOD in the equation editor?
I managed to work out how to enter mod in Latex, so the sum can be simplified to:\[S_n=\frac{n^2-(n\mod{2})}{4}\]
\[s_{n}=n^{2}/4 , or (n^{2}-1)/4\]
for even values of n, \(S_n=\frac{n^2}{4}\), and for odd values of n, \(S_n=\frac{n^2-1}{4}\). these can be combined into a single expression using the "mod" operator as I showed above.
Join our real-time social learning platform and learn together with your friends!