login

Reminder: The OEIS is hiring a new managing editor, and the application deadline is January 26.

Let w(1)=w(2)=w(3)=1, w(n) = (-1)^floor(n/2)*sign(w(n-1)-w(n-2))*w(n-3), then a(n) = 1+w(n).
0

%I #14 Jun 14 2020 13:01:21

%S 2,2,2,1,0,2,1,2,2,1,2,2,1,2,0,1,2,2,1,0,0,1,2,0,1,0,0,1,0,0,1,0,2,1,

%T 0,0,1,2,2,1,0,2,1,2,2,1,2,2,1,2,0,1,2,2,1,0,0,1,2,0,1,0,0,1,0,0,1,0,

%U 2,1,0,0,1,2,2,1,0,2,1,2,2,1,2,2,1,2,0,1,2,2,1,0,0,1,2,0,1,0,0,1,0,0,1,0,2

%N Let w(1)=w(2)=w(3)=1, w(n) = (-1)^floor(n/2)*sign(w(n-1)-w(n-2))*w(n-3), then a(n) = 1+w(n).

%F A 36-periodic sequence with period (1, 0, 2, 1, 2, 2, 1, 2, 2, 1, 2, 0, 1, 2, 2, 1, 0, 0, 1, 2, 0, 1, 0, 0, 1, 0, 0, 1, 0, 2, 1, 0, 0, 1, 2, )

%F From _Chai Wah Wu_, Jun 12 2020: (Start)

%F a(n) = a(n-1) - a(n-18) + a(n-19) for n > 20.

%F G.f.: x*(x^19 - x^18 - x^16 - x^15 + 2*x^14 - x^13 + x^12 - x^10 + x^9 - x^7 + x^6 - 2*x^5 + x^4 + x^3 - 2)/(x^19 - x^18 + x - 1). (End)

%K nonn

%O 1,1

%A _Benoit Cloitre_, Nov 24 2002