Given:
x0=1
x1=2
xn+2=xn1+xn+1
Let us calculate the next few terms:
x2=x01+x1=11+2=3
x3=x11+x2=21+3=2
x4=x21+x3=31+2=1
Let us continue calculating to see if there's a repeating pattern:
x5=x31+x4=21+1=1
x6=x41+x5=11+1=2
x7=x51+x6=11+2=3
x8=x61+x7=21+3=2
x9=x71+x8=31+2=1
The sequence is: 1,2,3,2,1,1,2,3,2,1,1,2,3,2,1,...
Starting from x0, the sequence repeats every 5 terms:
x0=1
x1=2
x2=3
x3=2
x4=1
Then it repeats:
x5=1 (same as x0)
x6=2 (same as x1)
x7=3 (same as x2)
Since the sequence has a period of 5, we need to find the remainder when 2021 is divided by 5:
2021=5×404+1
The remainder is 1, which means x2021=x1=2.
(Please note that in a periodic sequence, the index determines the term, not the position within a completed block. If the period is 5, then xn=xnmod5. Thus, 2020≡0(mod5)⇒x2020=x0, while 2021≡1(mod5)⇒x2021=x1.
=x1=2.