# General Formula For Sequence

• Apr 19th 2010, 01:40 PM
vReaction
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.
• Apr 19th 2010, 01:55 PM
tonio
Quote:

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
• Apr 19th 2010, 01:56 PM
Plato
Quote:

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)$.
• Apr 19th 2010, 02:07 PM
vReaction
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.
• Apr 19th 2010, 02:37 PM
Plato
Quote:

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$
• Apr 19th 2010, 03:09 PM
Soroban
Hello, vReaction!

Quote:

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$

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

. . $\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$