cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

A007538 A self-generating sequence: there are a(n) 3's between successive 2's.

This page as a plain text file.
%I A007538 M0432 #46 Feb 05 2024 11:36:40
%S A007538 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 A007538 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 A007538 3,3,2,3,3,3,2,3,3,3,2,3,3,3,2,3
%N A007538 A self-generating sequence: there are a(n) 3's between successive 2's.
%C A007538 (a(n)) is the unique fixed point of the morphism 2->233, 3->2333 (immediate from its definition). - _Michel Dekking_, Feb 21 2017
%D A007538 N. J. A. Sloane and Simon Plouffe, The Encyclopedia of Integer Sequences, Academic Press, 1995 (includes this sequence).
%H A007538 Reinhard Zumkeller, <a href="/A007538/b007538.txt">Table of n, a(n) for n = 1..1000</a>
%H A007538 Bryce Emerson Blackham, <a href="https://scholarsarchive.byu.edu/etd/6735">Subtraction Games: Range and Strict Periodicity</a>, Master's thesis, 2018.
%H A007538 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 A007538 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 A007538 a(n) = floor( n*(1+sqrt(3)) ) - floor( (n-1)*(1+sqrt(3)) ).
%F A007538 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 A007538 a(n) = A080757(n-1) + 1; a(n) = A188068(n) + 2. - _Reinhard Zumkeller_, Feb 14 2012
%F A007538 a(A188069(n)) = 2; a(A188070(n)) = 3. - _Reinhard Zumkeller_, Feb 14 2012
%t A007538 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 A007538 Table[Floor[n (1 + Sqrt@ 3)] - Floor[(n - 1) (1 + Sqrt@ 3)], {n, 120}] (* _Michael De Vlieger_, Oct 08 2016 *)
%t A007538 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 A007538 (Haskell)
%o A007538 a007538 n = f n 2 2 2 where
%o A007538    f 1 b _ _ = b
%o A007538    f n b 0 i = f (n - 1) 2 (a007538 i) (i + 1)
%o A007538    f n b c i = f (n - 1) 3 (c - 1) i
%o A007538 -- _Reinhard Zumkeller_, Feb 14 2012
%K A007538 nonn,easy,nice
%O A007538 1,1
%A A007538 _N. J. A. Sloane_, _Simon Plouffe_