# A simple Sequence

• February 7th 2008, 11:56 PM
zellster87
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
• February 8th 2008, 12:27 AM
wingless
$a_n = 3 - 2(-1)^n$
• February 8th 2008, 12:48 AM
wingless
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$