%I M0432 #46 Feb 05 2024 11:36:40
%S 2,3,3,2,3,3,3,2,3,3,3,2,3,3,2,3,3,3,2,3,3,3,2,3,3,3,2,3,3,2,3,3,3,2,
%T 3,3,3,2,3,3,3,2,3,3,2,3,3,3,2,3,3,3,2,3,3,2,3,3,3,2,3,3,3,2,3,3,3,2,
%U 3,3,2,3,3,3,2,3,3,3,2,3,3,3,2,3
%N A self-generating sequence: there are a(n) 3's between successive 2's.
%C (a(n)) is the unique fixed point of the morphism 2->233, 3->2333 (immediate from its definition). - _Michel Dekking_, Feb 21 2017
%D N. J. A. Sloane and Simon Plouffe, The Encyclopedia of Integer Sequences, Academic Press, 1995 (includes this sequence).
%H Reinhard Zumkeller, <a href="/A007538/b007538.txt">Table of n, a(n) for n = 1..1000</a>
%H Bryce Emerson Blackham, <a href="https://scholarsarchive.byu.edu/etd/6735">Subtraction Games: Range and Strict Periodicity</a>, Master's thesis, 2018.
%H The Fifty-Fourth William Lowell Putnam Mathematical Competition, <a href="http://www.jstor.org/stable/2974527">Problem A-6</a>, Amer. Math. Monthly, 101 (1994), 727-728.
%H The Fifty-Fourth William Lowell Putnam Mathematical Competition, <a href="http://www.jstor.org/stable/2690693">Problem A-6</a>, Math. Mag., 67 (No. 2, 1994), 157-158.
%F a(n) = floor( n*(1+sqrt(3)) ) - floor( (n-1)*(1+sqrt(3)) ).
%F a(n) = f(n,2,2,2) with f(n,b,c,i) = if n=1 then b else (if c=0 then f(n-1,2,a(i),i+1) else f(n-1,3,c-1,i)). - _Reinhard Zumkeller_, May 25 2009
%F a(n) = A080757(n-1) + 1; a(n) = A188068(n) + 2. - _Reinhard Zumkeller_, Feb 14 2012
%F a(A188069(n)) = 2; a(A188070(n)) = 3. - _Reinhard Zumkeller_, Feb 14 2012
%t f[n_, b_, c_, i_] := f[n, b, c, i] = If[n == 1, b, If[c == 0 , f[n-1, 2, a[i], i+1], f[n-1, 3, c-1, i]]]; a[n_] := f[n, 2, 2, 2]; Table[a[n], {n, 1, 100}] (* _Jean-François Alcover_, Oct 15 2013, after _Reinhard Zumkeller_ *)
%t Table[Floor[n (1 + Sqrt@ 3)] - Floor[(n - 1) (1 + Sqrt@ 3)], {n, 120}] (* _Michael De Vlieger_, Oct 08 2016 *)
%t t = {2};Table[If[t[[i]] == 2, AppendTo[t, #] & /@ {3, 3, 2}, AppendTo[t, #] & /@ {3, 3, 3, 2}], {i, 20}];t (* _Horst H. Manninger_, Jan 11 2024 *)
%o (Haskell)
%o a007538 n = f n 2 2 2 where
%o f 1 b _ _ = b
%o f n b 0 i = f (n - 1) 2 (a007538 i) (i + 1)
%o f n b c i = f (n - 1) 3 (c - 1) i
%o -- _Reinhard Zumkeller_, Feb 14 2012
%K nonn,easy,nice
%O 1,1
%A _N. J. A. Sloane_, _Simon Plouffe_