login
The OEIS is supported by the many generous donors to the OEIS Foundation.

 

Logo
Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A007538 A self-generating sequence: there are a(n) 3's between successive 2's.
(Formerly M0432)
13
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, 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, 3, 3, 2, 3, 3, 3, 2, 3, 3, 3, 2, 3, 3, 3, 2, 3 (list; graph; refs; listen; history; text; internal format)
OFFSET
1,1
COMMENTS
(a(n)) is the unique fixed point of the morphism 2->233, 3->2333 (immediate from its definition). - Michel Dekking, Feb 21 2017
REFERENCES
N. J. A. Sloane and Simon Plouffe, The Encyclopedia of Integer Sequences, Academic Press, 1995 (includes this sequence).
LINKS
Bryce Emerson Blackham, Subtraction Games: Range and Strict Periodicity, Master's thesis, 2018.
The Fifty-Fourth William Lowell Putnam Mathematical Competition, Problem A-6, Amer. Math. Monthly, 101 (1994), 727-728.
The Fifty-Fourth William Lowell Putnam Mathematical Competition, Problem A-6, Math. Mag., 67 (No. 2, 1994), 157-158.
FORMULA
a(n) = floor( n*(1+sqrt(3)) ) - floor( (n-1)*(1+sqrt(3)) ).
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
a(n) = A080757(n-1) + 1; a(n) = A188068(n) + 2. - Reinhard Zumkeller, Feb 14 2012
a(A188069(n)) = 2; a(A188070(n)) = 3. - Reinhard Zumkeller, Feb 14 2012
MATHEMATICA
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 *)
Table[Floor[n (1 + Sqrt@ 3)] - Floor[(n - 1) (1 + Sqrt@ 3)], {n, 120}] (* Michael De Vlieger, Oct 08 2016 *)
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 *)
PROG
(Haskell)
a007538 n = f n 2 2 2 where
f 1 b _ _ = b
f n b 0 i = f (n - 1) 2 (a007538 i) (i + 1)
f n b c i = f (n - 1) 3 (c - 1) i
-- Reinhard Zumkeller, Feb 14 2012
CROSSREFS
Sequence in context: A102313 A262955 A276859 * A242285 A238756 A025076
KEYWORD
nonn,easy,nice
AUTHOR
STATUS
approved

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recents
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified March 19 01:57 EDT 2024. Contains 370952 sequences. (Running on oeis4.)