Kolakoski sequence
In mathematics, the Kolakoski sequence, sometimes also known as the Oldenburger–Kolakoski sequence,[1] is an infinite sequence of symbols {1,2} that is the sequence of run lengths in its own run-length encoding.[2] It is named after the recreational mathematician William Kolakoski (1944–97) who described it in 1965,[3] but it was previously discussed by Rufus Oldenburger in 1939.[1][4]
Definition
The initial terms of the Kolakoski sequence are:
Each symbol occurs in a "run" (a sequence of equal elements) of either one or two consecutive terms, and writing down the lengths of these runs gives exactly the same sequence:
- 1,2,2,1,1,2,1,2,2,1,2,2,1,1,2,1,1,2,2,1,2,1,1,2,1,2,2,1,1,2,1,1,2,1,2,2,1,2,2,1,1,2,1,2,2,...
- 1, 2 , 2 ,1,1, 2 ,1, 2 , 2 ,1, 2 , 2 ,1,1, 2 ,1,1, 2 , 2 ,1, 2 ,1,1, 2 ,1, 2 , 2 ,1,1, 2 ,...
The description of the Kolakoski sequence is therefore reversible. If K stands for "the Kolakoski sequence", description #1 logically implies description #2 (and vice versa):
- 1. The terms of K are generated by the runs (i.e., run-lengths) of K
- 2. The runs of K are generated by the terms of K
Accordingly, one can say that each term of the Kolakoski sequence generates a run of one or two future terms. The first 1 of the sequence generates a run of "1", i.e. itself; the first 2 generates a run of "22", which includes itself; the second 2 generates a run of "11"; and so on. Each number in the sequence is the length of the next run to be generated, and the element to be generated alternates between 1 and 2:
- 1,2 (length of sequence l = 2; sum of terms s = 3)
- 1,2,2 (l = 3, s = 5)
- 1,2,2,1,1 (l = 5, s = 7)
- 1,2,2,1,1,2,1 (l = 7, s = 10)
- 1,2,2,1,1,2,1,2,2,1 (l = 10, s = 15)
- 1,2,2,1,1,2,1,2,2,1,2,2,1,1,2 (l = 15, s = 23)
As can be seen, the length of the sequence at each stage is equal to the sum of terms in the previous stage. This animation illustrates the process:
These self-generating properties, which remain if the sequence is written without the initial 1, mean that the Kolakoski sequence can be described as a fractal, or mathematical object that encodes its own representation on other scales.[1] Bertran Steinsky has created a recursive formula for the i-th term of the sequence[5] but the sequence is conjectured to be aperiodic,[6] that is, its terms do not have a general repeating pattern (cf. irrational numbers like π and √2).
Research
Density
It seems plausible that the density of 1s in the Kolakoski {1,2}-sequence is 1/2, but this conjecture remains unproved.[6] Václav Chvátal has proved that the upper density of 1s is less than 0.50084.[7] Nilsson has used the same method with far greater computational power to obtain the bound 0.500080.[8]
Although calculations of the first 3×108 values of the sequence appeared to show its density converging to a value slightly different from 1/2,[5] later calculations that extended the sequence to its first 1013 values show the deviation from a density of 1/2 growing smaller, as one would expect if the limiting density actually is 1/2.[9]
Connection with tag systems
The Kolakoski sequence can also be described as the result of a simple cyclic tag system. However, as this system is a 2-tag system rather than a 1-tag system (that is, it replaces pairs of symbols by other sequences of symbols, rather than operating on a single symbol at a time) it lies in the region of parameters for which tag systems are Turing complete, making it difficult to use this representation to reason about the sequence.[10]
Algorithms
The Kolakoski sequence may be generated by an algorithm that, in the i-th iteration, reads the value xi that has already been output as the i-th value of the sequence (or, if no such value has been output yet, sets xi = i). Then, if i is odd, it outputs xi copies of the number 1, while if i is even, it outputs xi copies of the number 2. Thus, the first few steps of the algorithm are:
- The first value has not yet been output, so set x1 = 1, and output 1 copy of the number 1
- The second value has not yet been output, so set x2 = 2, and output 2 copies of the number 2
- The third value x3 was output as 2 in the second step, so output 2 copies of the number 1.
- The fourth value x4 was output as 1 in the third step, so output 1 copy of the number 2. Etc.
This algorithm takes linear time, but because it needs to refer back to earlier positions in the sequence it needs to store the whole sequence, taking linear space. An alternative algorithm that generates multiple copies of the sequence at different speeds, with each copy of the sequence using the output of the previous copy to determine what to do at each step, can be used to generate the sequence in linear time and only logarithmic space.[9]
See also
- Golomb sequence — another self-generating sequence based on run-length
- Gijswijt's sequence
- Look-and-say sequence
Notes
- ↑ 1.0 1.1 1.2 Sloane, N. J. A., ed. "Sequence A000002 (Kolakoski sequence: a(n) is length of n-th run; a(1) = 1; sequence consists just of 1's and 2's)". OEIS Foundation. https://oeis.org/A000002.
- ↑ Pytheas Fogg, N. (2002). Berthé, Valérie; Ferenczi, Sébastien; Mauduit, Christian et al.. eds. Substitutions in dynamics, arithmetics and combinatorics. Lecture Notes in Mathematics. 1794. Berlin: Springer-Verlag. p. 93. ISBN 3-540-44141-7.
- ↑ Kolakoski, William (1965). "Problem 5304". American Mathematical Monthly 72: 674. doi:10.2307/2313883. For a partial solution, see Üçoluk, Necdet (1966). "Self Generating Runs". American Mathematical Monthly 73: 681–682. doi:10.2307/2314839.
- ↑ Oldenburger, Rufus (1939). "Exponent trajectories in symbolic dynamics". Transactions of the American Mathematical Society 46 (3): 453–466. doi:10.2307/1989933.
- ↑ 5.0 5.1 Steinsky, Bertran (2006). "A recursive formula for the Kolakoski sequence A000002". Journal of Integer Sequences 9 (3): Article 06.3.7. Bibcode: 2006JIntS...9...37S. http://www.emis.de/journals/JIS/VOL9/Steinsky/steinsky5.pdf.
- ↑ 6.0 6.1 Kimberling, Clark. "Integer Sequences and Arrays". University of Evansville. http://faculty.evansville.edu/ck6/integer/index.html.
- ↑ Chvátal, Vašek (December 1993). Notes on the Kolakoski Sequence. Technical Report 93-84. DIMACS. http://dimacs.rutgers.edu/TechnicalReports/abstracts/1993/93-84.html.
- ↑ Nilsson, J.. "Letter Frequencies in the Kolakoski Sequence". Acta Physics Polonica A. http://przyrbwn.icm.edu.pl/APP/PDF/126/a126z2p31.pdf.
- ↑ 9.0 9.1 Nilsson, Johan (2012). "A space-efficient algorithm for calculating the digit distribution in the Kolakoski sequence". Journal of Integer Sequences 15 (6): Article 12.6.7, 13. http://www.emis.de/journals/JIS/VOL15/Nilsson/nilsson5.pdf.
- ↑ "Substitution automata, functional equations and "functions algebraic over a finite field"". Papers in algebra, analysis and statistics (Hobart, 1981). Contemporary Mathematics. 9. Providence, Rhode Island: American Mathematical Society. 1981. pp. 307–312. See in particular p. 308.
Further reading
- Allouche, Jean-Paul; Shallit, Jeffrey (2003). Automatic Sequences: Theory, Applications, Generalizations. Cambridge University Press. p. 337. ISBN 978-0-521-82332-6. https://archive.org/details/automaticsequenc00jpal.
- Dekking, F. M. (1997). "What Is the Long Range Order in the Kolakoski Sequence?". in Moody, R. V.. Dordrecht, Netherlands: Kluwer. pp. 115–125.
- Fedou, J. M.; Fici, G. (2010). "Some remarks on differentiable sequences and recursivity". Journal of Integer Sequences 13 (3): Article 10.3.2. http://hal.archives-ouvertes.fr/docs/00/46/35/72/PDF/Some_remarks_on_differentiable_sequences_and_recursivity.pdf.
- Keane, M. S. (1991). "Ergodic Theory and Subshifts of Finite Type". in Bedford, T.; Keane, M.. Oxford, England: Oxford University Press. pp. 35–70.
- Lagarias, J. C. (1992). "Number Theory and Dynamical Systems". in Burr, S. A.. Providence, RI: American Mathematical Society. pp. 35–72. ISBN 9780821855010. https://books.google.com/books?id=j-pLi01XbFUC&pg=PA35.
- Păun, Gheorghe; Salomaa, Arto (1996). "Self-Reading Sequences". American Mathematical Monthly 103 (2): 166–168. doi:10.2307/2975113.
- Shallit, Jeffrey (1999). "Number theory and formal languages". in Hejhal, Dennis A.; Friedman, Joel; Gutzwiller, Martin C. et al.. Emerging applications of number theory. Based on the proceedings of the IMA summer program, Minneapolis, MN, USA, July 15--26, 1996. The IMA volumes in mathematics and its applications. 109. Springer-Verlag. pp. 547–570. ISBN 0-387-98824-6.
External links
- Weisstein, Eric W.. "Kolakoski Sequence". http://mathworld.wolfram.com/KolakoskiSequence.html.
- Kolakoski Constant to 25000 digits as computed by Olivier Gerard in April 1998
Original source: https://en.wikipedia.org/wiki/Kolakoski sequence.
Read more |