5

I see I can split it up into two arithmetic series (1,4,7... and 2,5,8...) and add the two sums, but what is the compact notation for the sum of these two series as a function of n?

Ido Sarig
  • 187
  • 10
    You should define your sequence clearly. I assume it's just the naturals less the multiples of $3$ but why make your readers guess? If I am correct, the answer is then the difference between a triangular number and three times another triangular number. – lulu Sep 02 '18 at 03:50

3 Answers3

10

Your sequence $1,2,4,5,7,8,\dots$ satisfies the second order nonhomogeneous linear recurrence $$a_n=a_{n-2}+3$$ with initial values $$a_1=1,\ a_2=2.$$ The solution is $$a_n=\frac{6n-3-(-1)^n}4.$$ The sum of the first $n$ terms is $$\sum_{k=1}^n a_k=\frac34n^2+\frac{1-(-1)^n}8=\boxed{\frac34n^2+\frac{1-\cos n\pi}8}.$$

bof
  • 78,265
  • 1
    Did you guess this sequence or can you conclude this formula for $a_n$ once you notice it satisfies this second order nonhomogeneous linear recurrence? – Cornman Sep 02 '18 at 04:11
  • Thanks. I am not familiar with such homogeneous equations. I think this is some valuable inside! – Cornman Sep 02 '18 at 04:17
  • @Szeto I'm not sure I understand your question. I wanted to put the final answer in the simplest, nicest possible form. – bof Sep 02 '18 at 05:39
  • 4
    @bof $(-1)^n$ is usually considered the simpler, nicer form, especially in combinatorics. – mephistolotl Sep 02 '18 at 06:46
  • 1
    @bof Don't you think $(-1)^n$ is good enough? – Szeto Sep 02 '18 at 06:46
  • @Szeto I guess $(-1)^n$ is good enough. (Really up to the OP to decide.) I guess some expression with floor and ceiling functions is good enough. Or maybe $$\frac{3n^2+[n\equiv1\pmod2]}4$$ using Iverson bracket notation. I wrote my final answer the way I did because I liked it better. Didn't know it would be so damned controversial. Sorry I took the time to answer the question. All the people who are upvoting your comments should just downvote my answer. – bof Sep 02 '18 at 08:34
  • @mephistolotl Is usually considered, is it? I consider otherwise. By the way, I still consider Pluto to be a planet. – bof Sep 02 '18 at 08:38
  • 2
    @bof Using an extra $\cos$ does not make your answer bad. – Szeto Sep 02 '18 at 08:39
4

If you consider $$a_k=1+3k\qquad b_k=2+3k$$ then $$\sum_{k=0}^n a_k=\sum_{k=0}^n (1+3k)=\sum_{k=0}^n 1+3\sum_{k=0}^n k=n+1+3 \frac{1}{2} n (n+1)=\frac{1}{2} (n+1) (3 n+2)$$ $$\sum_{k=0}^n b_k=\sum_{k=0}^n (2+3k)=2\sum_{k=0}^n 1+3\sum_{k=0}^n k=2(n+1)+3 \frac{1}{2} n (n+1)=\frac{1}{2} (n+1) (3 n+4)$$

Just continue.

2

Let us first find the formula for even $n$. In this case, $m = n/2$ is a whole number, and moreover the sum of the first $n$ elements of your sequence is the sum of the first $m$ elements of the two arithmetic progressions, that is, $$ m + 3\frac{m(m-1)}{2} + 2m + 3\frac{m(m-1)}{2} = 3 (m + m(m-1)) = \frac{3n^2}{4}. $$

If $n$ is odd, then $n-1$ is even and we know that the sum of the first $n-1$ entries is $\frac{3(n-1)^2}{4}$. Moreover, the last entry in the sequence was the $((n-1)/2 + 1)$-st entry of the first arithmetic progression, that is $1,4,7,10, \ldots$. But the value of that entry is $3 ((n-1)/2 + 1) - 2 = 3(n-1)/2 + 1$, so using the formula for the even case, the sum of the first $n$ entries equals $$ \frac{3(n-1)^2}{4} + 3(n-1)/2 + 1 = \frac{3}{4} (n^2 - 2n + 2n + 1 - 2 + 4/3) = \frac{3n^2}{4} + \frac{1}{4}. $$

Cloudscape
  • 5,124
  • 1
    Thanks, I get it, But shouldn't that sentence read "If n is odd, then n−1 is even and we know that the sum of the first n−1 entries is [3⋅(n−1)]^2/4?. – Ido Sarig Sep 02 '18 at 18:33
  • 1
    You're completely right. I don't know why I wrote that. Reloading the page should yield the corrected version. – Cloudscape Sep 02 '18 at 18:36