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

A289673 Take n-th string over {1,2} in lexicographic order and apply the Post tag system described in A284116 (but adapted to the alphabet {1,2}) just once.

Original entry on oeis.org

-1, 12, 1, 1, 212, 212, 11, 11, 11, 11, 2212, 2212, 2212, 2212, 111, 211, 111, 211, 111, 211, 111, 211, 12212, 22212, 12212, 22212, 12212, 22212, 12212, 22212, 1111, 1211, 2111, 2211, 1111, 1211, 2111, 2211, 1111, 1211, 2111, 2211, 1111, 1211, 2111, 2211, 112212
Offset: 1

Views

Author

N. J. A. Sloane, Jul 29 2017

Keywords

Comments

Post's tag system maps a word w over {1,2} to w', where if w begins with 1, w' is obtained by appending 11 to w and deleting the first three letters, or if w begins with 2, w' is obtained by appending 2212 to w and deleting the first three letters.
The empty word is denoted by -1.
We work over {1,2} rather than the official alphabet {0,1} because of the prohibition in the OEIS of terms (other than 0 itself) which begin with 0.

Examples

			The initial words are:
1,2,11,12,21,22,111,112,121,122,211,212,221,222,1111,...
Applying the tag system over {1,2} these become:
-1, 12, 1, 1, 212, 212, 11, 11, 11, 11, 2212, 2212, 2212, 2212, 111, ...
If we were working over {0,1} the initial strings would be:
0,1,00,01,10,11,000,001,010,011,100,101,110,111,0000,...
and applying the tag system over {0,1} described in A284116 these would become:
-1, 01, 0, 0, 101, 101, 00, 00, 00, 00, 1101, 1101, 1101, 1101, 000, ...
		

Crossrefs

Programs

  • Maple
    See A291072.
  • Python
    from itertools import product
    A289673_list = [-1 if s == ('1',) else int((''.join(s)+('2212' if s[0] == '2' else '11'))[3:]) for l in range(1,10) for s in product('12',repeat=l)] # Chai Wah Wu, Aug 06 2017

Extensions

More terms from Chai Wah Wu, Aug 06 2017

A291069 Largest number of distinct words arising in Watanabe's tag system {00, 0111} applied to a binary word w, over all starting words w of length n.

Original entry on oeis.org

5, 4, 4, 14, 13, 12, 25, 24, 23, 38, 37, 36, 53, 52, 51, 68, 67, 66, 85, 84, 83, 102, 101, 100, 119, 118, 117, 138, 137, 136, 157, 156, 155, 176, 175, 174, 195, 194, 193, 214, 213, 212, 235, 234, 233, 256, 255, 254, 277, 276
Offset: 1

Views

Author

N. J. A. Sloane, Aug 18 2017

Keywords

Comments

Watanabe's tag system {00, 0111} maps a word w over {0,1} to w', where if w begins with 0, w' is obtained by appending 00 to w and deleting the first three letters, or if w begins with 1, w' is obtained by appending 0111 to w and deleting the first three letters.
The empty word is included in the count.
Comment from Don Reble, Aug 25 2017: (Start)
The following comment applies to both the 3-shift tag systems {00,1110} (A291068) and {00,0111} (A291069). Number the bits in a binary word w starting at the left with bit 0. For the trajectory of w under the tag system, only bits numbered 0,3,6,9,... are important, the others (the unimportant bits) having no effect on the outcome.
An important 1 bit produces 0111 or 1110, and exactly one of those new 1 bits is important. The number of important 1's never changes. So the number of initial words of length n that terminate (the analog of A289670) is just 2^(number-of-unimportant-bits) = 2^(floor(2*n/3)) = A291778.
The number that end in a cycle is 2^n - 2^(floor(2*n/3)) = A291779.
Furthermore, the number of important zeros is eventually bounded.
Proof. If a word has A important zeros and B important ones, then after A+B steps, there will be at most 2A+4B bits, and at most (2A+4B+2)/3 important bits. B of them are important ones, so at most (2A+B+2)/3 are important zeros.
If A >= B+3, then (2A+B+2)/3 <= (2A+A-1)/3 < A. If A < B+3, then (2A+B+2)/3 < (3B+8)/3 = B+2. The first kind must shrink; the second kind can't grow past A+B+2. QED
Ultimately, a word with B important ones has at most A+B+2 important bits, so can't diverge. So the word "finite" in the definition was unnecessary and has been omitted. (End)

Examples

			Examples of strings that achieve these records: "1", "10", "000", "1001", "10010", "100100", "1001001".
		

Crossrefs

For the 3-shift tag systems {00,1101}, {00, 1011}, {00, 1110}, {00, 0111} see A284116, A291067, A291068, A291069 respectively (as well as the cross-referenced entries mentioned there).
Cf. A291074.

Programs

  • Maple
    See link.

Extensions

a(8)-(50) from Lars Blomberg, Sep 16 2017

A291072 Take n-th string over {1,2} in lexicographic order and apply the Watanabe tag system {00, 1011} described in A291067 (but adapted to the alphabet {1,2}) just once.

Original entry on oeis.org

-1, 22, 1, 1, 122, 122, 11, 11, 11, 11, 2122, 2122, 2122, 2122, 111, 211, 111, 211, 111, 211, 111, 211, 12122, 22122, 12122, 22122, 12122, 22122, 12122, 22122, 1111, 1211, 2111, 2211, 1111, 1211, 2111, 2211, 1111, 1211, 2111, 2211, 1111, 1211, 2111, 2211, 112122, 122122, 212122, 222122
Offset: 1

Views

Author

N. J. A. Sloane, Aug 18 2017

Keywords

Crossrefs

Programs

  • Maple
    # First define the mapping by defining the strings T1 and T2:
    # Work over the alphabet {1,2}
    # 11 / 2212 A284116 This is the "Post Tag System"
    T1:="11"; T2:="2212";
    # 11 / 2122 A291067 These three are from the Watanabe paper
    T1:="11"; T2:="2122";
    # 11 / 2221 A291068
    T1:="11"; T2:="2221";
    # 11 / 1222 A291069
    T1:="11"; T2:="1222";
    with(StringTools):
    # the mapping:
    f1:=proc(w) local L, ws, w2; global T1,T2;
    ws:=convert(w, string);
    if ws="-1" then return("-1"); fi;
    if ws[1]="1" then w2:=Join([ws, T1], ""); else w2:=Join([ws, T2], "");  fi;
    L:=length(w2); if L <= 3 then return("-1"); fi;
    w2[4..L]; end;
    # Construct list of words over {1,2} (A007931)
    a:= proc(n) local m, r, d; m, r:= n, 0;
          while m>0 do d:= irem(m, 2, 'm');
            if d=0 then d:=2; m:= m-1 fi;
            r:= d, r
          od; parse(cat(r))/10
        end:
    WLIST := [seq(a(n), n=1..100)];
    # apply the map once:
    # this produces A289673, A291072, A291073, A291074
    W2:=map(f1,WLIST);

A291073 Take n-th string over {1,2} in lexicographic order and apply the Watanabe tag system {00, 1110} described in A291068 (but adapted to the alphabet {1,2}) just once.

Original entry on oeis.org

-1, 21, 1, 1, 221, 221, 11, 11, 11, 11, 2221, 2221, 2221, 2221, 111, 211, 111, 211, 111, 211, 111, 211, 12221, 22221, 12221, 22221, 12221, 22221, 12221, 22221, 1111, 1211, 2111, 2211, 1111, 1211, 2111, 2211, 1111, 1211, 2111, 2211, 1111, 1211, 2111
Offset: 1

Views

Author

N. J. A. Sloane, Aug 18 2017

Keywords

Crossrefs

Programs

Showing 1-4 of 4 results.