# Math Help - A simple Sequence

1. ## A simple Sequence

Question: Find a formula for the sequence in terms of "n"

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

This sequence looks pretty straight forward, I mean its easy see the pattern. However, I just cant seem to come up with a formula that would work for any number "n". This is is bugging me...lol

thanks, -matt

2. $a_n = 3 - 2(-1)^n$

3. After posting that answer, I saw that we can generalize this as a rule

$a_n = {a,b,a,b,a,b,....}$

$a_n = \frac{a+b}{2} - \frac{a-b}{2}(-1)^n$