%I #23 Jun 30 2023 15:21:36
%S 3,2,3,2,3,2,3,2,3,2,3,2,3,2,3,2,3,2,3,2,3,2,3,2,3,2,3,2,3,2,3,2,3,2,
%T 3,2,3,2,3,2,3,2,3,2,3,2,3,2,3,2,3,2,3,2,3,2,3,2,3,2,3,2,3,2,3,2,3,2,
%U 3,2,3,2,3,2,3,2,3,2,3,2,3,2,3,2,3,2,3,2,3,2,3,2,3,2,3,2,3,2,3,2,3,2,3,2,3
%N Periodic sequence: Repeat 3, 2.
%C Interleaving of A010701 and A007395.
%C Also continued fraction expansion of (3+sqrt(15))/2.
%C Also decimal expansion of 32/99.
%C a(n) = A010693(n+1).
%C Essentially first differences of A047218.
%C Binomial transform of 3 followed by -A122803.
%C Inverse binomial transform of 3 followed by A020714.
%C Second inverse binomial transform of A057198 without initial term 1.
%H <a href="/index/Rec#order_02">Index entries for linear recurrences with constant coefficients</a>, signature (0, 1).
%F a(n) = (5+(-1)^n)/2.
%F a(n) = a(n-2) for n > 1; a(0) = 3, a(1) = 2.
%F a(n) = -a(n-1)+5 for n > 0; a(0) = 3.
%F a(n) = 3*((n+1) mod 2)+2*(n mod 2).
%F G.f.: (3+2*x)/((1-x)*(1+x)).
%p A176059:=n->(5+(-1)^n)/2; seq(A176059(n), n=0..100); # _Wesley Ivan Hurt_, Feb 26 2014
%t a[n_] := {3, 2}[[Mod[n, 2] + 1]]; Table[a[n], {n, 0, 104}] (* _Jean-François Alcover_, Jul 19 2013 *)
%t PadRight[{},120,{3,2}] (* _Harvey P. Dale_, Oct 06 2019 *)
%o (Magma) &cat[ [3, 2]: n in [0..52] ];
%o [ (5+(-1)^n)/2: n in [0..104] ];
%o (Haskell)
%o a176059 = (3 -) . (`mod` 2) -- _Reinhard Zumkeller_, Nov 27 2012
%o (Haskell)
%o a176059_list = cycle [3,2] -- _Reinhard Zumkeller_, Apr 04 2012
%o (PARI) a(n)=3-n%2 \\ _Charles R Greathouse IV_, Jul 13 2016
%Y Cf. A010701 (all 3's sequence), A007395 (all 2's sequence), A176058 (decimal expansion of (3+sqrt(15))/2), A010693 (repeat 2, 3), A047218 (congruent to {0, 3} mod 5), A122803 (powers of -2), A020714 (5*2^n), A057198 ((5*3^(n-1)+1)/2, n > 0).
%Y Cf. A026532 (partial products).
%K cofr,cons,nonn,easy
%O 0,1
%A _Klaus Brockhaus_, Apr 07 2010
|