A108103 Fixed point of the square of the morphism: 1->3, 2->1, 3->121, starting with 1.
1, 2, 1, 3, 1, 2, 1, 3, 1, 3, 1, 2, 1, 3, 1, 2, 1, 3, 1, 3, 1, 2, 1, 3, 1, 3, 1, 2, 1, 3, 1, 2, 1, 3, 1, 3, 1, 2, 1, 3, 1, 2, 1, 3, 1, 3, 1, 2, 1, 3, 1, 3, 1, 2, 1, 3, 1, 2, 1, 3, 1, 3, 1, 2, 1, 3, 1, 3, 1, 2, 1, 3, 1, 2, 1, 3, 1, 3, 1, 2, 1, 3, 1, 2, 1, 3, 1, 3, 1, 2, 1, 3, 1, 3, 1, 2, 1, 3, 1, 2, 1, 3, 1, 3, 1
Offset: 1
Keywords
References
- F. M. Dekking: "What is the long range order in the Kolakoski sequence?" in: The Mathematics of Long-Range Aperiodic Order, ed. R. V. Moody, Kluwer, Dordrecht (1997), pp. 115-125.
Links
- Michel Dekking, Table of n, a(n) for n = 1..1200
- F. M. Dekking, On the structure of self-generating sequences, Seminar on Number Theory, 1980-1981 (Talence, 1980-1981), Exp. No. 31, 6 pp., Univ. Bordeaux I, Talence, 1981. Math. Rev. 83e:10075.
- F. M. Dekking, What Is the Long Range Order in the Kolakoski Sequence?, Report 95-100, Technische Universiteit Delft, 1995.
Programs
-
Mathematica
s[1] = {3}; s[2] = {1}; s[3] = {1, 2, 1}; t[a_] := Flatten[s /@ a]; p[0] = {1}; p[1] = t[p[0]]; p[n_] := t[p[n - 1]] a = p[12] Nest[Flatten[# /. {1 -> {3}, 2 -> {1}, 3 -> {1, 2, 1}}] &, {1}, 10] (* Robert G. Wilson v, Nov 05 2015 *)
-
Python
from math import isqrt def A108103(n): return 1 if n&1 else 1+((k:=n>>1)+isqrt(m:=5*k**2)>>1)-(k-1+isqrt(m-10*k+5)>>1) # Chai Wah Wu, May 05 2025
Formula
1->121, 2->3, 3->313.
Extensions
New name from Joerg Arndt, Jan 17 2013
New name from Robert G. Wilson v, Nov 05 2015
Name corrected by Michel Dekking, Dec 27 2017
Offset 1 from Michel Dekking, Jan 01 2020
Comments