Simple recurring sequence (1, 2, 1, 2, 1, 2, 1, 2, )

  • Thread starter rekshaw
  • Start date
  • #1
15
0

Main Question or Discussion Point

trivial yet my mind is blank, I'm wayyy overthinking this!

Was just thinking of a simple sequence to test-drive on my calculator, and this one came up in my mind (the sequence terms, not the sequence itself...)

I've been trying for the past hour to find a simbolic representation of a sequence that will spit out: 1, 2, 1, 2, 1, 2...

The farthest I got so far is to get it to give back 0, 2, 0, 2 with this:

[itex]a_{n} = 1+(-1)^{n}[/itex]

From [tex]a_{1}[/tex] to [tex]a_{5}[/tex] it gives me: 0, 2, 0, 2, 0

I know it's probably the easiest thing in the world...
 

Answers and Replies

  • #2
Borek
Mentor
28,398
2,800
1.5+0.5=2, 1.5-0.5=1
 
  • #3
CRGreathouse
Science Advisor
Homework Helper
2,820
0
If you can find an expression for 0, 2, 0, 2, ... you should be able to find one for 0, 1, 0, 1, 0, .... If you can find one for 0, 1, 0, 1, 0, ... you should be able to find one for 1, 2, 1, 2, 1, ....

Alternately, it's a recurrence relation with a_{n+1} = 3 - a_n. You can find a second-order homogeneous recurrence relation if you prefer.
 
  • #4
1,033
1
so they would be saying 1.5 + (0.5)(-1)^n
 
  • #5
15
0
so they would be saying 1.5 + (0.5)(-1)^n
Naturally! Thanks very much guys and sorry for the trivial question.
 

Related Threads on Simple recurring sequence (1, 2, 1, 2, 1, 2, 1, 2, )

Replies
10
Views
15K
Replies
13
Views
4K
Replies
6
Views
2K
Replies
4
Views
464
Replies
2
Views
1K
  • Last Post
Replies
5
Views
3K
  • Last Post
Replies
13
Views
3K
Replies
2
Views
2K
Top