# Thread: General Formula For Sequence

1. ## General Formula For Sequence

Find the general formula (for the nth term) for the sequence

{5,1,5,1,5,1,...}

assuming the pattern continues.

I've tried a lot of things but can't come up with a solution...it seems innocent enough. It seems like the formula should depend on n being even or odd but I can't get anything to work. A suggestion would be appreciated. Is there a specific way to solve these or are you supposed to just spot the pattern. Thanks.

2. Originally Posted by vReaction
Find the general formula (for the nth term) for the sequence

{5,1,5,1,5,1,...}

assuming the pattern continues.

I've tried a lot of things but can't come up with a solution...it seems innocent enough. It seems like the formula should depend on n being even or odd but I can't get anything to work. A suggestion would be appreciated. Is there a specific way to solve these or are you supposed to just spot the pattern. Thanks.

$a_n=\left\{\begin{array}{ll}5&,\,if\,\,\,n\,\,\,is \,\,\,odd\\1&,\,if\,\,\,n\,\,\,is\,\,\,even\end{ar ray}\right.$

Tonio

3. Originally Posted by vReaction
Find the general formula (for the nth term) for the sequence {5,1,5,1,5,1,...}, assuming the pattern continues.
Try $x_n=5\cdot \text{mod}(n,2)+\text{mod}(n+1,2)$.

4. Tonio: Thanks...I didn't think it'd be that simple.

Plato: I'm unfamiliar with "mod"...I searched and only found modular arithmetic which looked very confusing. Thanks though.

5. Originally Posted by vReaction
: I'm unfamiliar with "mod"...I searched and only found modular arithmetic which looked very confusing.
It is not confusing at all.
$\text{mod}(j,k)$ is the remainder when $j$ is divided by $k$.
So $\text{mod}(3,2)=1$ and $\text{mod}(4,2)=0$

$\text{mod}(5,3)=2$ and $\text{mod}(12,6)=0$

6. Hello, vReaction!

Find the $n^{th}$ term for the sequence: . $5,1,5,1,5,1\:\hdots$

The sequence is: . $(3+2),\;(3-2),\;(3+2),\;(3-2),\;\hdots$

Therefore: . $a_n \;=\;3 - (\text{-}1)^n\!\cdot\!2$

~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~

Consider these two functions:

. . $\frac{1-(\text{-}1)^n}{2} \;=\;\begin{Bmatrix}1 & n \text{ odd} \\ 0 & n\text{ even} \end{Bmatrix}$

. . $\frac{1+(\text{-}1)^n}{2} \;=\;\begin{Bmatrix} 0 & n\text{ odd} \\ 1 & n\text{ even} \end{Bmatrix}$

Given the sequence: . $A,B,A,B,A,B\:\hdots$

. . then: . $a_n \;\;=\;\;\frac{1-(\text{-}1)^n}{2}\cdot A \:+\: \frac{1+(\text{-}1)^n}{2}\cdot B$