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-2 of 2 results.

A022292 Exactly half of first a(n) terms of Kolakoski sequence A000002 are 1's (not known to be infinite).

Original entry on oeis.org

0, 2, 4, 6, 8, 10, 14, 16, 18, 20, 22, 24, 26, 28, 30, 36, 38, 40, 42, 44, 46, 48, 50, 54, 56, 58, 60, 62, 64, 68, 70, 72, 74, 76, 78, 80, 82, 86, 88, 98, 104, 106, 116, 118, 122, 124, 126, 128, 130, 132, 136, 138, 140, 142, 144, 146, 148, 150, 152, 158
Offset: 0

Views

Author

Keywords

Comments

The sequences A022292, A074261, and A342799 partition the nonnegative integers. - Clark Kimberling, May 10 2021

Crossrefs

Programs

  • JavaScript
    a=new Array();
    a[1]=1; a[2]=2; a[3]=2; cd=1; ap=3;
    for (i=4; i<1000; i++)
    {
        if (a[ap]==1) a[i]=cd;
        else {a[i]=cd; a[i+1]=cd; i++}
        ap++;
        cd=3-cd;
    }
    oc=0; tc=0;
    for (i=1; i<1000; i++)
    {
        if (oc==tc) document.write(i-1+", ");
        if (a[i]==1) oc++;
        else tc++;
    }
    // Jon Perry, Sep 11 2012
  • Mathematica
    k = Prepend[Nest[Flatten[Partition[#, 2] /. {{2, 2} -> {2, 2, 1, 1}, {2, 1} -> {2, 2, 1}, {1, 2} -> {2, 1, 1}, {1, 1} -> {2, 1}}] &, {2, 2}, 14], 1]; (* A000002 *)
    Select[Range[400], Count[Take[k, #], 1] < #/2 &]   (* A074261 *)
    Select[Range[400], Count[Take[k, #], 1] == #/2 &]  (* A022292 *)
    Select[Range[400], Count[Take[k, #], 1] > #/2 &]   (* A342799 *)
    (* Clark Kimberling, May 10 2021 *)

Formula

Conjecture: a(n) is asymptotic to c*n*log(n) for some constant c <= 1. - Benoit Cloitre, Nov 17 2003

Extensions

0 prepended by Jon Perry, Sep 11 2012

A342799 Numbers m such that there are more 1s than 2s in {K(1), .., K(m)}, where K = A000002 (Kolakoski sequence).

Original entry on oeis.org

1, 5, 7, 17, 23, 25, 29, 31, 32, 33, 34, 35, 37, 41, 43, 49, 51, 52, 53, 55, 59, 61, 71, 73, 79, 125, 131, 133, 134, 135, 137, 141, 143, 149, 161, 179, 185, 187, 191, 193, 194, 195, 196, 197, 199, 201, 202, 203, 205, 209, 211, 221, 223, 227, 229, 230, 231
Offset: 1

Views

Author

Clark Kimberling, May 10 2021

Keywords

Comments

The three sequences A022292 (without the initial 0), A074261, and A342799 partition the positive integers.

Examples

			The Kolakoski sequence is (1, 2, 2, 1, 1, 2, 1, 2, 2, 1, 2, 2, 1, 1, 2, ...), so that a(1) = 1, a(2) = 5.
		

Crossrefs

Programs

  • Mathematica
    k = Prepend[Nest[Flatten[Partition[#, 2] /. {{2, 2} -> {2, 2, 1, 1}, {2, 1} -> {2, 2, 1}, {1, 2} -> {2, 1, 1}, {1, 1} -> {2, 1}}] &, {2, 2}, 14], 1]; (* A000002 *)
    Select[Range[400], Count[Take[k, #], 1] < #/2 &]   (* A074261 *)
    Select[Range[400], Count[Take[k, #], 1] == #/2 &]  (* A022292 *)
    Select[Range[400], Count[Take[k, #], 1] > #/2 &]   (* A342799 *)
Showing 1-2 of 2 results.