My specific question is about how I would write a sequence in explicit form, when the sequence has an explicit form for its odd and even terms. So, using notation, if:

$$a_n = \begin{cases} a_{n_1} & n\space \text{even} \\ a_{n_2} & n\space\text{odd} \\ \end{cases}$$

What is an explicit form for $a_n$ in terms of $a_{n_1}$ and $a_{n_2}$? I assume there's an easy answer but I just thought of this on a whim and don't really care enough to spend hours trying to figure out a solution. For that matter, what if we have this case? Suppose $a_n$ goes by a different rule not depending on its remainder mod $2,$ but its remainder mod $k$. So, say it's defined as follows:

$$a_n = \begin{cases} a_{n_1} & n\equiv 0\space(\text{mod}\space k) \\ a_{n_2} & n\equiv 1\space(\text{mod}\space k) \\ .\\ .\\ .\\ a_{n_{k-1}} & n\equiv k-1\space(\text{mod}\space k)\\ \end{cases}$$

Can we get one explicit expression for $a_n$?

  • $\begingroup$ If you want, you can use roots of unity (or equivalently sine and cosines) to get a single "formula". But that is pointless and \begin{cases}...\end{cases} is already explicit. $\endgroup$ Jun 1, 2021 at 5:50
  • $\begingroup$ Perhaps "explicit" wasn't the right word, as you're correct, it is explicit. I should have said "not piecewise" or something to that effect. $\endgroup$
    – Luna145
    Jun 1, 2021 at 6:00

1 Answer 1


One can make use of periodic functions such as trigonometric functions. For example, in the case of $\hbox{mod }2$, write $a_n=|\sin(n\pi)|a_{n_2}+|\cos(n\pi)|a_{n_1}$. One, can also make use of roots of unity. For example, the same formula can be written as $a_n=\dfrac{1-(-1)^n}{2}a_{n_2}+\dfrac{1+(-1)^n}{2}a_{n_1}$. Similarly, for $\hbox{mod k}$, try to make use of $k$th roots of unity. For $\hbox{mod } 3$, note that $\dfrac{1+{\omega}^n+{\omega}^{2n}}{3}$ is $0$ for $n \neq 3k, k \in \mathbb{Z}$ and is $1$ for $n=3k, k \in \mathbb{Z}$.


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.