Calculate the first few terms of the sequence:
- x0=1
- x1=2
- x2=x01+x1=11+2=3
- x3=x11+x2=21+3=2
- x4=x21+x3=31+2=1
- x5=x31+x4=21+1=1
- x6=x41+x5=11+1=2
- x7=x51+x6=11+2=3
The sequence is periodic with period 5: (1,2,3,2,1,1,2,3,2,1,…).
Notice indices:
x0=1,x1=2,x2=3,x3=2,x4=1.
To find x2021:
2021(mod5)=1
So x2021=x1=2.