Creating a series that skips every $n^\text{th}$ term? 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.

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).
