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.

A064353 Kolakoski-(1,3) sequence: the alphabet is {1,3}, and a(n) is the length of the n-th run.

Original entry on oeis.org

1, 3, 3, 3, 1, 1, 1, 3, 3, 3, 1, 3, 1, 3, 3, 3, 1, 1, 1, 3, 3, 3, 1, 3, 3, 3, 1, 3, 3, 3, 1, 1, 1, 3, 3, 3, 1, 3, 1, 3, 3, 3, 1, 1, 1, 3, 3, 3, 1, 3, 3, 3, 1, 1, 1, 3, 3, 3, 1, 3, 3, 3, 1, 1, 1, 3, 3, 3, 1, 3, 1, 3, 3, 3, 1, 1, 1, 3, 3, 3, 1, 3, 3, 3, 1, 3, 3, 3, 1, 1, 1, 3, 3, 3, 1, 3, 1, 3, 3, 3, 1, 1, 1, 3, 3
Offset: 1

Views

Author

Keywords

Comments

Historical note: the sequence (a(n)) was introduced (by me) in 1981 in a seminar in Bordeaux. It was remarked there that (a(n+1)) is a morphic sequence, i.e., a letter-to-letter projection of a fixed point of a morphism. The morphism is 1->3, 2->2, 3->343, 4->212. The letter-to-letter map is 1->1, 2->1, 3->3, 4->3. There it was also remarked that this allows one to compute the frequency of the letter 3, and an exact expression for this frequency involving sqrt(177) was given. - Michel Dekking, Jan 06 2018
The frequency of the number '3' is 0.6027847... See UWC link. - Jaap Spies, Dec 12 2004
The terms 13, 13331, 13331113331 are primes. - Vincenzo Librandi, Mar 02 2016
Consider the Kolakoski sequence generalized to the alphabet {A,B}, where A=2p+1, B=2q+1. The fraction of symbols that are A approaches f_A, calculated as follows: x=(p+q+1)/3; y=((p-q)^2)/2; lambda = x + (x^3+y+sqrt(y^2+2*x^3*y))^(1/3) + (x^3+y-sqrt(y^2+2*x^3*y))^(1/3); f_A=(lambda-2q-1)/(2p-2q). The technique is the "simple computation" mentioned by Dekking and repeated in the UWC link. - Ed Wynn, Jul 29 2019

References

  • E. Angelini, "Jeux de suites", in Dossier Pour La Science, pp. 32-35, Volume 59 (Jeux math'), April/June 2008, Paris.
  • 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.

Crossrefs

See also A362927, A362928 (subtract 2 from the terms). For indices of 1's and 3's, see A362929, A362930.

Programs

  • Haskell
    -- from John Tromp's a000002.hs
    a064353 n = a064353_list !! (n-1)
    a064353_list = 1 : 3 : drop 2
       (concat . zipWith replicate a064353_list . cycle $ [1, 3])
    -- Reinhard Zumkeller, Aug 02 2013
  • MATLAB
    A = [1 3 3 3]; i = 3; next = 1; while length(A) < 140 A = [A next*ones(1, A(i))]; i = i + 1; next = 4 - next; end
    
  • Mathematica
    A = {1, 3, 3, 3}; i = 3; next = 1; While[Length[A] < 140, A = Join[A, next*Array[1&, A[[i]]]]; i++; next = 4-next]; A (* Jean-François Alcover, Nov 12 2016, translated from MATLAB *)

Extensions

More terms from David Wasserman, Jul 16 2002
Edited by Charles R Greathouse IV, Apr 20 2010
Restored the original definition, following a suggestion from Jianing Song. - N. J. A. Sloane, May 13 2021