4

I want to write a function using sigma notation that could represent an arbitrary number of terms of, for example, $1+2+4+5+7+8+10+11+13\ldots$, skipping every third term. I think one would need functions like floor and mod, but I'm not certain.

TonyK
  • 64,559
  • I think you want $$\sum_{k=1}^{\frac{n}{3}} (3k-2) + (3k - 1)$$

    provided that $3|n$. (If not, you will need to make slight modifications.)

    – Chris Jun 10 '17 at 02:22
  • 1
  • Do you mean find the value of the sum $\sum_{k=1}^? \left\lfloor\frac{3k-1}{2}\right\rfloor$? Or given any sequence $a_1, a_2, \ldots$, find a notation to express the sum $a_1, a_2, a_4, a_5, a_7, a_8, \ldots$. In that case, the sum can be expressed as $\sum_{k=1}^? a_{\left\lfloor\frac{3k-1}{2}\right\rfloor}$. – achille hui Jun 10 '17 at 02:28
  • My solution doesn't use floor and mod, splitting it up into even and odd cases (of how many terms have passed) will solve the problem. – Toby Mak Jun 10 '17 at 02:33
  • 1
    @Jonathan Doliver Just a tip - you can accept any post you think to be the most helpful to your question below the down arrow next to the question you want. There have been several answers posted - if you are satisfied with none of them you don't have to accept. – Toby Mak Jun 10 '17 at 05:33

6 Answers6

6

You want this

$$\sum_{k=1}^nk-\sum_{k=1}^{\lfloor n/3\rfloor}3k=\frac12\Big((n+1)n-3(\lfloor n/3\rfloor+1)\lfloor n/3\rfloor\Big)$$

Masacroso
  • 30,417
4

To get a periodic pattern like "multiply by 1, multiply by 1, multiply by 0", we can exploit a periodic function like cosine: $$\sum_{k=1}^nk*\frac{2-2\cos(2\pi k/3)}3$$ This is the sum up to $n$ where every third term is zero. The number of nonzero terms is $\lfloor2(n+1)/3\rfloor$ where I'm using the floor function.

For other discussion of tricks/notation for periodic sequences, see this answer.

Mark S.
  • 23,925
3

Ok I misinterpreted your question originally. For one, you can just define a function $f\colon \Bbb N \to \Bbb R$ where $f(1)=1$, $f(2)=2$, and $f(n)=f(n-2)+3$.

$f(3)=f(1)+3=4$

$f(4)=f(2)+3=5$

$f(6)=f(3)+3=7.$

This is a well defined function, although you may be looking for something that doesn't use induction so you can program it into a computer.

pancini
  • 19,216
2

If $n=3K+p $ with $0\le p <3$,

it is

$$\sum_{i=1}^ni -3\sum_{i=1}^K i $$

$$=\frac {n (n+1)}{2}-3\frac{K (K+1)}{2} $$

$$=\frac {1}{2}\Bigl ( n^2-3K^2+p\Bigr) $$

2

Notice that splitting the series into two groups gives $(1+2) + (4+5) + (7+8)\cdots$, which is also $3 + 9 + 15\cdots$ or $3(1 + 3 + 5\cdots)$.

Since the sum of consecutive odd numbers is $k^2$, when the series ends on an even number of terms the sum is $3 (n/2)^2$. For an odd number of terms you can modify the sum by subtracting the last term, so the sum can be represented as $(3(n/2)^2) - n-1$.

In this sequence, $n$ is the number of terms rounded up to an even number, and $n$ has to be an integer > $1$.

Toby Mak
  • 16,827
1

The $r$-th roots of unity $\exp\left(\frac{2\pi ij}{r}\right), 0\leq j<r$ have the nice property to filter elements. For $r>0$ we obtain \begin{align*} \frac{1}{r}\sum_{j=0}^{r-1}\exp\left(\frac{2\pi ij n}{r}\right)= \begin{cases} 1&\qquad r\mid n\\ 0& \qquad otherwise \end{cases} \end{align*}

In case $r=3$ we obtain the sequence \begin{align*} \left(\frac{1}{3}\sum_{j=0}^2\exp\left(\frac{2\pi ijn}{3}\right)\right)_{n=0}^{\infty} =(1,0,0,1,0,0,1,0,0,1,0,0,1,\ldots) \end{align*} which generates a $1$ at each $3$-rd position and $0$ otherwise.

If we need the positions of $1$ shifted by $k$ positions to the right, we subtract $k$ from the index $j$. With $k=2$ we get \begin{align*} \left(\frac{1}{3}\sum_{j=0}^2\exp\left(\frac{2\pi i(j-2)n}{3}\right)\right)_{n=0}^{\infty} =(0,0,1,0,0,1,0,0,1,0,0,1,0,\ldots) \end{align*}

and reverting the sequence by subtracting the elements from $1$ we finally get \begin{align*} \left(1-\frac{1}{3}\sum_{j=0}^2\exp\left(\frac{2\pi i(j-2)n}{3}\right)\right)_{n=0}^{\infty} =(1,1,\color{blue}{0},1,1,\color{blue}{0},1,1,\color{blue}{0},1,1,\color{blue}{0},1,\ldots) \end{align*}

Multiplying this sequence elementwise with $(a_n)_{n=0}^\infty$ and summing up the values gives the wanted series with each third element skipped.

Hint: Some instructive examples can be found in H.S. Wilf's book generatingfunctionology, (2.4.5) to (2.4.9).

Markus Scheuer
  • 108,315