%I #81 Dec 12 2023 09:25:16
%S 1,2,1,1,2,1,1,2,1,1,2,1,1,2,1,1,2,1,1,2,1,1,2,1,1,2,1,1,2,1,1,2,1,1,
%T 2,1,1,2,1,1,2,1,1,2,1,1,2,1,1,2,1,1,2,1,1,2,1,1,2,1,1,2,1,1,2,1,1,2,
%U 1,1,2,1,1,2,1,1,2,1,1,2,1,1,2,1,1,2,1,1,2,1,1,2,1,1,2,1,1,2,1,1,2,1,1,2,1
%N Period 3: repeat [1, 2, 1].
%C Partial sums of A106510. Inverse binomial transform of A024495 (without leading zeros). - _Philippe Deléham_, Nov 26 2008
%C a(n) = A130196(n) - A022003(n) = A080425(n) - A130196(n)+2 = A153727(n)/A130196(n). - _Reinhard Zumkeller_, Nov 12 2009
%C Continued fraction expansion of A177346, (1+sqrt(10))/3. - _Klaus Brockhaus_, May 07 2010
%C From _Daniel Forgues_, May 04 2016: (Start)
%C a(n) = GCD of terms of the sequence S_n = {F_i+F_{i+1}+F_{i+2}+...+F_{i+2n}, i >= 0}, where F_i denotes a Fibonacci number. See A210209.
%C a(n) = GCD of terms of the sequence S_n = {L_i+L_{i+1}+L_{i+2}+...+L_{i+2n}, i >= 0}, where L_i denotes a Lucas number. See A229339. (End)
%H <a href="/index/Rec#order_03">Index entries for linear recurrences with constant coefficients</a>, signature (0,0,1).
%F G.f.: (x+1)^2/((1-x)*(x^2+x+1)). - _R. J. Mathar_, Nov 14 2007
%F a(n) = 4/3 + (2/3)*cos(2*Pi*(n+2)/3). - _Jaume Oliver Lafont_, May 09 2008
%F a(n) = A101825(n+1). - _R. J. Mathar_, Jun 13 2008
%F a(n) = gcd(F(n)^2+F(n+1)^2, F(n)+F(n+1)). - _Gary Detlefs_, Dec 29 2010
%F a(n) = 2 - ((n+2)^2 mod 3). - _Gary Detlefs_, Oct 13 2011
%F a(n) = ceiling(n*4/3) - ceiling((n-1)*4/3). - _Tom Edgar_, Jul 22 2014
%F a(n) = 2 - abs(3*floor(n/3)+1-n). - _Mikael Aaltonen_, Jan 02 2015
%F a(n) = 1+[3|(2n+1)], using Iverson bracket. - _Daniel Forgues_, May 04 2016
%F a(n) = a(n-3) for n>2. - _Wesley Ivan Hurt_, Jul 05 2016
%p A131534:=n->(-n mod 3)^(n mod 3): seq(A131534(n), n=0..100); # _Wesley Ivan Hurt_, Aug 29 2014
%t PadRight[{},120,{1,2,1}] (* _Harvey P. Dale_, Aug 06 2013 *)
%o (PARI) a(n)=1+(n%3==1) \\ _Jaume Oliver Lafont_, Mar 20 2009
%o (Magma) [(-n mod 3)^(n mod 3) : n in [0..100]]; // _Wesley Ivan Hurt_, Aug 29 2014
%Y Cf. A167808. - _Reinhard Zumkeller_, Nov 12 2009
%Y Cf. A000045, A022003, A024495, A080425, A101825, A106510, A130196, A153727, A177346, A210209, A229339.
%K nonn,easy
%O 0,2
%A _Paul Curtz_, Aug 26 2007