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.

Showing 1-7 of 7 results.

A111123 Number of 2's in n-th "Kolakoski" string defined in A054349.

Original entry on oeis.org

1, 2, 2, 3, 5, 8, 11, 16, 25, 38, 57, 85, 127, 192, 289, 430, 644, 966, 1450, 2173, 3263, 4899, 7341, 11022, 16526, 24802, 37201, 55808, 83702, 125541, 188301, 282444, 423683, 635569, 953356, 1429969, 2144990, 3217454, 4826176, 7239129, 10858479, 16287972, 24431890
Offset: 0

Views

Author

Benoit Cloitre, Oct 16 2005

Keywords

Comments

Also the number of terms in n-th string (starting from n=3) when representing A000002 as a tree. Each branch of this tree is a string. Starting from n=3, each 1 in n-th string generates either 1 or 2 in (n+1)-th string and each 2 in n-th string generates either 11 or 22 in (n+1)-th string based on the previously generated term of either 2 or 1. Hence, the number of terms in (n+1)-th string is the sum of all terms in n-th string. - Rakesh Khanna A, May 24 2020

Crossrefs

Cf. A001083, A042942, A054349, A111124 (number of 1's).

Programs

  • Mathematica
    l = { (*terms in A042942*) }; For[i = 2, i <= Length[l], i++, Print[l[[i]] - l[[i - 1]]]]

Formula

a(0) + a(1) + ... + a(n) = A042942(n+2) - 1.
a(n) = A001083(n+4) - A001083(n+3). - Benoit Cloitre, Nov 07 2010

Extensions

More terms from and offset changed to 0 by Jinyuan Wang, Apr 03 2020

A111124 Number of 1's in n-th "Kolakoski" string defined in A054349.

Original entry on oeis.org

0, 0, 2, 3, 4, 6, 11, 17, 24, 36, 55, 84, 127, 189, 284, 432, 648, 970, 1452, 2179, 3262, 4889, 7346, 11006, 16524, 24774, 37177, 55771, 83685, 125548, 188329, 282487, 423692, 635489, 953271, 1430014, 2144962, 3217488, 4826220, 7239443, 10859222, 16288208, 24432262
Offset: 0

Views

Author

Benoit Cloitre, Oct 16 2005

Keywords

Crossrefs

Cf. A001083, A042942, A054349, A111123 (number of 2's).

Extensions

More terms from and offset changed to 0 by Jinyuan Wang, Apr 03 2020

A054351 Successive generations of the Kolakoski sequence A000002.

Original entry on oeis.org

1, 12, 1221, 1221121, 12211212212, 122112122122112112, 1221121221221121122121121221, 1221121221221121122121121221121121221221121, 12211212212211211221211212211211212212211212212112112212211212212
Offset: 0

Views

Author

N. J. A. Sloane, May 07 2000

Keywords

Crossrefs

Word lengths give A054352.

Programs

  • Python
    from itertools import accumulate, groupby, repeat
    def K(n, _):
      c, s = "12", ""
      for i, k in enumerate(str(n)): s += c[i%2]*int(k)
      return int(s + c[(i+1)%2])
    def aupton(nn): return list(accumulate(repeat(1, nn+1), K))
    print(aupton(8)) # Michael S. Branicky, Jan 12 2021

Extensions

More terms from Antonio G. Astudillo (afg_astudillo(AT)lycos.com), Apr 05 2003

A054352 Lengths of successive generations of the Kolakoski sequence A000002.

Original entry on oeis.org

1, 2, 4, 7, 11, 18, 28, 43, 65, 99, 150, 226, 340, 511, 768, 1153, 1728, 2590, 3885, 5826, 8742, 13116, 19674, 29514, 44280, 66431, 99667, 149531, 224306, 336450, 504648, 756961, 1135450, 1703197, 2554846, 3832292, 5748474, 8622646, 12933971, 19400955, 29101203
Offset: 0

Views

Author

N. J. A. Sloane, May 07 2000

Keywords

Comments

Starting with a(0) = 1, the first term of A000002, the n-th generation is the run of figures directly generated from the preceding generation completed with a single last figure which begins the next run. Thus a(0) = 1 -> 1-2 -> 1-22-1 -> 1-2211-2-1 etc. - Jean-Christophe Hervé, Oct 26 2014
It seems that the limit (c =) lim_{n -> oo} a(n)/(3/2)^n exists, with c = 2.63176..., so a(n) ~ (3/2)*a(n-1) ~ c * (3/2)^n, for large n. - A.H.M. Smeets, Apr 12 2024

Crossrefs

Programs

  • Mathematica
    A2 = {1, 2, 2}; Do[If[Mod[n, 10^5] == 0, Print["n = ", n]]; m = 1 + Mod[n - 1, 2]; an = A2[[n]]; A2 = Join[A2, Table[m, {an}]], {n, 3, 10^6}]; A054353 = Accumulate[A2]; Clear[a]; a[0] = 1; a[n_] := a[n] = A054353[[a[n - 1]]] + 1; Table[a[n], {n, 0, 33}] (* Jean-François Alcover, Oct 30 2014, after Jean-Christophe Hervé *)
  • Python
    def aupton(nn):
      alst, A054353, idx = [1], 0, 1
      K = Kolakoski()  # using Kolakoski() in A000002
      for n in range(2, nn+1):
        target = alst[-1]
        while idx <= target:
          A054353 += next(K)
          idx += 1
        alst.append(A054353 + 1)  # a(n) = A054353(a(n-1))+1
      return alst
    print(aupton(36))  # Michael S. Branicky, Jan 12 2021

Formula

a(0) = 1, and for n > 0, a(n) = A054353(a(n-1))+1. - Jean-Christophe Hervé, Oct 26 2014

Extensions

a(7)-a(32) from John W. Layman, Aug 20 2002
a(33) from Jean-François Alcover, Oct 30 2014
a(34) and beyond from Michael S. Branicky, Jan 12 2021

A054350 Triangular array whose rows are successive generations of the Kolakoski sequence A000002.

Original entry on oeis.org

1, 1, 2, 1, 2, 2, 1, 1, 2, 2, 1, 1, 2, 1, 1, 2, 2, 1, 1, 2, 1, 2, 2, 1, 2, 1, 2, 2, 1, 1, 2, 1, 2, 2, 1, 2, 2, 1, 1, 2, 1, 1, 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, 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
Offset: 0

Views

Author

N. J. A. Sloane, May 07 2000

Keywords

Examples

			Triangle begins:
1;
1, 2;
1, 2, 2, 1;
1, 2, 2, 1, 1, 2, 1;
1, 2, 2, 1, 1, 2, 1, 2, 2, 1, 2;
1, 2, 2, 1, 1, 2, 1, 2, 2, 1, 2, 2, 1, 1, 2, 1, 1, 2;
...
		

Crossrefs

Row lengths give A054352.

Extensions

More terms from Antonio G. Astudillo (afg_astudillo(AT)lycos.com), Apr 05 2003

A054348 Triangular array whose rows are successive generations of the variant of the Kolakoski sequence described in A042942.

Original entry on oeis.org

2, 2, 2, 2, 2, 1, 1, 2, 2, 1, 1, 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, 2, 2, 1, 1, 2, 1, 2, 2, 1, 2, 2, 1, 1, 2, 1, 1, 2, 2, 1, 2, 1, 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
Offset: 0

Views

Author

N. J. A. Sloane, May 07 2000

Keywords

Examples

			Triangle begins:
2;
2, 2;
2, 2, 1, 1;
2, 2, 1, 1, 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;
...
		

Crossrefs

Row lengths give A042942.

Extensions

More terms from David Wasserman, Mar 04 2002

A111081 Successive generations of an alternating Kolakoski rule.

Original entry on oeis.org

1, 2, 11, 21, 221, 22112, 11221211, 21221121121, 2212211212212112, 1122122112122122112112122, 12112212211212212211211221211212212211, 211212211211221211211221221121221211221221211211221221121
Offset: 1

Views

Author

Benoit Cloitre, Oct 11 2005

Keywords

Comments

Strings are obtained using the Kolakoski substitution and the additional rule : start with 1 if previous string ends with 2, start with 2 if previous string ends with 1. The concatenation of those strings gives 1211212212211211221211...which is A006928 word. If you replace the initial 1 with 12 you get 122112122122112112212...the infinite Kolakoski word A000002.

Examples

			1-->2-->11-->21-->221-->22112-->11221211
		

Crossrefs

Formula

Conjecture : length of n-th string is asymptotic to c*(3/2)^n for some c.
Showing 1-7 of 7 results.