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-10 of 15 results. Next

A289677 a(n) = A289671(n)/2^f(n), where f(n) = 2*floor((n-1)/3) + ((n+2) mod 3) = A004523(n).

Original entry on oeis.org

0, 1, 1, 2, 2, 3, 4, 4, 5, 11, 12, 13, 22, 19, 20, 43, 46, 44, 85, 88, 89, 171, 185, 192, 366, 380, 396, 774, 793, 814, 1586, 1589, 1610, 3136, 3106, 3130, 6123, 6078, 6103, 12088, 12147, 12229, 24283, 24534, 24736, 49040, 49482, 49879, 99031, 99792, 100747, 200444, 201892, 203765, 405931, 408478, 411403
Offset: 1

Views

Author

N. J. A. Sloane, Aug 01 2017

Keywords

Comments

This is the number of distinct binary words w of length n that eventually cycle under the Post tag system (see A284116, A289670) reduced to take into account the observation made by Don Reble that (if the bits of w are labeled from the left starting at bit 0) bits 1,2,4,5,7,8,... (not a multiple of 3) are "junk DNA" and have no effect on the outcome.

Crossrefs

Programs

  • Python
    from _future_ import division
    def A289677(n):
        c, k, r, n2, cs, ts = 0, 1+(n-1)//3, 2**((n-1) % 3), 2**(n-1), set(), set()
        for i in range(2**k):
            j, l = int(bin(i)[2:],8)*r, n2
            traj = set([(l,j)])
            while True:
                if j >= l:
                    j = j*16+13
                    l *= 2
                else:
                    j *= 4
                    l //= 2
                if l == 0:
                    ts |= traj
                    break
                j %= 2*l
                if (l,j) in traj:
                    c += 1
                    cs |= traj
                    break
                if (l,j) in cs:
                    c += 1
                    break
                if (l,j) in ts:
                    break
                traj.add((l,j))
        return c # Chai Wah Wu, Aug 03 2017

Extensions

Corrected by Don Reble, Aug 01 2017 (there were errors in A289671).

A284116 a(n) = largest number of distinct words arising in Post's tag system {00, 1101} applied to a binary word w, over all starting words w of length n, or a(n) = -1 if there is a word w with an unbounded trajectory.

Original entry on oeis.org

4, 7, 6, 7, 22, 23, 24, 25, 30, 31, 34, 421, 422, 423, 422, 423, 424, 2169, 2170, 2171, 2170, 2171, 2172, 2165, 2166, 2167, 24566, 24567, 24568, 24567, 24568, 24569, 24568, 24569, 24570, 253513, 253514, 342079, 342080, 342083, 342084, 342103, 20858070
Offset: 1

Views

Author

Jeffrey Shallit, Mar 20 2017

Keywords

Comments

Post's tag system {00, 1101} 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 1101 to w and deleting the first three letters.
The empty word is included in the count.
It is an important open question to decide if there is any word whose orbit grows without limit. - N. J. A. Sloane, Jul 30 2017, based on an email from Allan C. Wechsler
Comment from Don Reble, Aug 01 2017: For n <= 57, all words reach the empty word or a cycle. - N. J. A. Sloane, Aug 01 2017
From David A. Corneth, Aug 02 2017: (Start)
A word w can be described by the pair (c, d) where c is the length of w and d is the number represented by the binary word w. Then 0 <= d < 2^c.
Appending a word ww of m letters to w is the same as setting d to 2^m * w + ww. Preserving only the rightmost q digits of w is the same as setting w to w mod 2^q.
Lastly, we're only really interested in the 1st, 4th, 7th, ... leftmost digits. The others could without loss of generality be set to 0. This can be done with bitand(x, y), with y in A033138.
Therefore this problem can be formulated as follows: Let w = (c, d).
Then if d < 2^(c - 1), w' = (c - 1, bitand(4*d, floor(2^(c + 1) / 7)))
else (if (d >= 2^(c - 1)), w' = (c + 1, bitand(16*d + 13, floor(2^(c + 3) / 7))).
To find a(n), it would be enough to check values d in A152111 with n binary digits and c = n.
(End)
a(110) >= 43913328040672, from w = (100)^k, k=110. - N. J. A. Sloane, Oct 23 2017, based on Lars Blomberg's work on A291792.

Examples

			Suppose n=1. Then w = 0 ->000 -> w' = empty word, and w = 1 -> 11101 -> w' = 01 -> 0100 -> w'' = 0 -> 000 -> w''' = empty word. So a(1) = 4 by choosing w = 1.
For n = 5 the orbit of the word 10010 begins 10010, 101101, 1011101, ..., 0000110111011101, and the next word in the orbit has already appeared. The orbit consists of 22 distinct words.
From _David A. Corneth_, Aug 02 2017: (Start)
The 5-letter word w = 10100 can be described as (a, b) = (5, 20). This is equivalent to (5, bitand(20, floor(2^7 / 7))) = (5, bitand(20, 18)) = (5, 16).
As 16 >= 2^(5-1), w' = (5 + 1, bitand(16*16 + 13, floor(2^(5 + 3) / 7))) = (6, bitand(279, 36)) = (6, 4). w'' = w = (5, 16) so 10100 ~ 10000 ends in a period. (End)
Words w that achieve a(1) through a(7) are 1, 10, 100, 0001, 10010, 100000, 0001000. - _N. J. A. Sloane_, Aug 17 2017
		

References

  • John Stillwell, Elements of Mathematics: From Euclid to Goedel, Princeton, 2016. See page 100, Post's tag system.

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).

Programs

  • Mathematica
    Table[nmax = 0;
     For[i = 0, i < 2^n, i++, lst = {};
      w = IntegerString[i, 2, n];
      While[! MemberQ[lst, w],
       AppendTo[lst, w];
       If[w == "", Break[]];
       If[StringTake[w, 1] == "0", w = StringDrop[w <> "00", 3],
        w = StringDrop[w <> "1101", 3]]];
    nmax = Max[nmax, Length[lst]]]; nmax, {n, 1, 12}] (* Robert Price, Sep 26 2019 *)
    (* Or, using the (c,d) procedure: *)
     Table[nmax = 0;
     For[i = 0, i < 2^n, i++,
      c = n; d = i; lst = {};
      While[! MemberQ[lst, {c, d}],
       AppendTo[lst, {c, d}];
       If[c == 0,  Break[]];
       If[ d < 2^(c - 1),
        d = BitAnd[4*d, 2^(c - 1) - 1]; c--,
        d = BitAnd[16*d + 13, 2^(c + 1) - 1]; c++]];
    nmax = Max[nmax, Length[lst]]]; nmax, {n, 1, 12}] (* Robert Price, Sep 26 2019 *)

Extensions

a(19)-a(43) from Lars Blomberg, Apr 09 2017
Edited by N. J. A. Sloane, Jul 29 2017 and Oct 23 2017 (adding escape clause in case an infinite trajectory exists)

A289670 Consider the Post tag system defined in A284116; a(n) = number of binary words of length n which terminate at the empty word.

Original entry on oeis.org

2, 2, 4, 8, 16, 16, 64, 128, 192, 320, 512, 768, 2560, 6656, 12288, 21504, 36864, 81920, 176128, 327680, 638976, 1392640, 2326528, 4194304, 9568256, 17301504, 30408704, 65536000, 121110528, 220200960, 484442112, 962592768, 1837105152, 4026531840, 8304721920, 16206790656, 34712059904, 70934069248, 140190416896
Offset: 1

Views

Author

N. J. A. Sloane, Jul 29 2017

Keywords

Comments

The orbit of a word may terminate at the empty word (this sequence and A289675), or enter a cycle (A289671, A289672, A289674), or grow without limit (it is not known if this ever happens).

Examples

			For length n=2, there are two words which terminate at the empty word, 00 and 01. For example, 00 -> 0 -> empty word. See A289675 for further examples.
		

Crossrefs

Programs

  • Maple
    with(StringTools):
    # Post's tag system applied once to w
    # The empty string is represented by -1.
    f1:=proc(w) local L,t0,t1,ws,w2;
    t0:="00"; t1:="1101"; ws:=convert(w,string);
    if ws[1]="0" then w2:=Join([ws,t0],""); else w2:=Join([ws,t1],"");  fi;
    L:=length(w2); if L <= 3 then return(-1); fi;
    w2[4..L]; end;
    # Post's tag system repeatedly applied to w (valid for |w| <= 11).
    # Returns number of steps to reach empty string, or 999 if w cycles
    P:=proc(w) local ws,i,M; global f1;
    ws:=convert(w,string); M:=1;
    for i from 1 to 38 do
    M:=M+1; ws:=f1(ws); if ws = -1 then return(M); fi;
    od; 999; end;
    # Count strings of length n which terminate and which cycle
    a0:=[]; a1:=[];
    for n from 1 to 11 do
    lprint("starting length ",n);
    ter:=0; noter:=0;
    for n1 from 0 to 2^n-1 do
    t1:=convert(2^n+n1,base,2); t2:=[seq(t1[i],i=1..n)];
    map(x->convert(x,string),t2); t3:=Join(%,""); t4:=P(%);
    if t4=999 then noter:=noter+1; else ter:=ter+1; fi;
    od;
    a0:=[op(a0),ter]; a1:=[op(a1),noter];
    od:
    a0; a1;
  • Mathematica
    Table[ne = 0;
     For[i = 0, i < 2^n, i++, lst = {};
      w = IntegerString[i, 2, n];
      While[! MemberQ[lst, w],
       AppendTo[lst, w];
       If[w == "", ne++; Break[]];
       If[StringTake[w, 1] == "0", w = StringDrop[w <> "00", 3],
        w = StringDrop[w <> "1101", 3]]]];
    ne, {n, 1, 12}] (* Robert Price, Sep 26 2019 *)

Extensions

a(12)-a(57) from Don Reble, Jul 30 2017 and Aug 01 2017; a(12)-a(39) confirmed by Sean A. Irvine, Jul 30 2017.

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

A289674 Consider the Post tag system described in A284116 (but adapted to the alphabet {1,2}); sequence lists the words that belong to cycles.

Original entry on oeis.org

21211, 112212, 21211221211, 112212112212, 221222121111, 1112212221211, 2122212111111, 2221211112212, 12111122122212, 12221222121111, 22121111112212, 122122212221211, 211111122122212, 1111221222122212, 21211221211221211, 21222122212111111, 112212112212112212
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.
Under this Post tag system, some words when iterated end at the empty word, others go into cycles, and others may have an orbit which grows without limit. See A289670 and A289671 for the counts of the first two types. This sequence gives a list of the words that belong to cycles.
It is an important open question to decide if there is any word whose orbit grows without limit.
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 first two cycles that one encounters when applying the Post tag system to words over the alphabet {1,2} are (21211, 112212) and (2122212111111, 22121111112212, 211111122122212, 1111221222122212, 122122212221211, 12221222121111).
		

Crossrefs

Extensions

Corrected and extended by Don Reble, Jul 31 2017
Terms sorted and more terms added by Chai Wah Wu, Aug 05 2017

A289675 Consider the Post tag system described in A284116 (but adapted to the alphabet {1,2}) ; sequence lists the words that terminate in the empty word.

Original entry on oeis.org

1, 2, 11, 12, 111, 112, 121, 122, 1111, 1121, 1211, 1221, 2111, 2121, 2211, 2221, 11111, 11112, 11121, 11122, 11211, 11212, 11221, 11222, 12111, 12112, 12121, 12122, 12211, 12212, 12221, 12222, 111111, 111112, 111121, 111122, 112111, 112112, 112121, 112122, 121111, 121112, 121121, 121122, 122111, 122112, 122121, 122122
Offset: 1

Views

Author

N. J. A. Sloane, Jul 30 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.
Under this Post tag system, some words when iterated end at the empty word, others go into cycles, and others may have an orbit which grows without limit. See A289670 and A289671 for the counts of the first two types. This sequence gives a list of the words that end at the empty word.
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.
Stillwell (2016, page 100) remarks that Post was unable to find an algorithm to determine which words belong to this sequence, "and in fact this particular `halting problem' remains unsolved to this day".

Examples

			Working over the more usual alphabet {0,1}, the following are the orbits of the first few words that terminate at the empty word:
[0, -1]
[1, 01, 0, -1]
[00, 0, -1]
[01, 0, -1]
[000, 00, 0, -1]
[001, 00, 0, -1]
[010, 00, 0, -1]
[011, 00, 0, -1]
[0000, 000, 00, 0, -1]
[0010, 000, 00, 0, -1]
[0100, 000, 00, 0, -1]
[0110, 000, 00, 0, -1]
[1000, 01101, 0100, 000, 00, 0, -1]
[1010, 01101, 0100, 000, 00, 0, -1]
[1100, 01101, 0100, 000, 00, 0, -1]
[1110, 01101, 0100, 000, 00, 0, -1]
[00000, 0000, 000, 00, 0, -1]
...
Writing the initial words in this list over {1,2} rather than {0,1} gives the sequence.
		

References

  • John Stillwell, Elements of Mathematics: From Euclid to Goedel, Princeton, 2016. See page 100, Post's tag system.

Crossrefs

Programs

  • Mathematica
    A289675 = {};
    Do[For[i = 0, i < 2^n, i++, lst = {};
       w = IntegerString[i, 2, n];
       While[! MemberQ[lst, w],
        AppendTo[lst, w];
        If[w == "", AppendTo[A289675, IntegerString[i, 2, n]]; Break[]];
        If[StringTake[w, 1] == "0", w = StringDrop[w <> "00", 3],
         w = StringDrop[w <> "1101", 3]]]], {n, 6}];
    Map[StringReplace[#, {"1" -> "2", "0" -> "1"}] &, A289675]
    (* Robert Price, Sep 26 2019 *)

A290436 a(n) = A289676(3*n+1).

Original entry on oeis.org

2, 2, 4, 5, 10, 21, 43, 85, 146, 250, 462, 960, 2069, 4296, 8485, 16496, 32041, 61700, 118357
Offset: 0

Views

Author

N. J. A. Sloane, Aug 02 2017

Keywords

Comments

No formulas or recurrences are known for the important sequences A289670 and A289671. The essence of these two sequences is captured in the six entries A290436-A290441. Any numerical properties of these would be most welcome.

Crossrefs

A290441 a(n) = A289677(3*n).

Original entry on oeis.org

1, 3, 5, 13, 20, 44, 89, 192, 396, 814, 1610, 3130, 6103, 12229, 24736, 49879, 100747, 203765, 411403
Offset: 1

Views

Author

N. J. A. Sloane, Aug 02 2017

Keywords

Comments

No formulas or recurrences are known for the important sequences A289670 and A289671. The essence of these two sequences is captured in the six entries A290436-A290441. Any numerical properties of these would be most welcome.

Crossrefs

A289672 Consider the Post tag system defined in A284116; a(n) = maximum, taken over all binary words w of length n which terminate in a cycle, of the number of words in the orbit of w.

Original entry on oeis.org

4, 3, 4, 7, 8, 7, 14, 15, 14, 15, 16, 15, 24, 25, 28, 29, 30, 35, 38, 39, 38, 39, 38
Offset: 1

Views

Author

N. J. A. Sloane, Jul 29 2017

Keywords

Comments

The terminating empty word is included in the count.

Examples

			For length n=2, there are two words which cycle, 10 and 11:
10 -> 101 -> 1101 -> 11101 -> 011101 -> 10100 -> 001101 -> 10100, which has entered a cycle.
		

Crossrefs

Programs

  • Maple
    # Uses procedures f1 and P from A289670.
    # Count strings of length n which terminate and which cycle
    # Print max length to reach empty word (mx)
    mx:=[];
    for n from 1 to 11 do
    lprint("starting length ",n);
    m:=0;
    for n1 from 0 to 2^n-1 do
    t1:=convert(2^n+n1,base,2); t2:=[seq(t1[i],i=1..n)];
    map(x->convert(x,string),t2); t3:=Join(%,""); t4:=P(%);
    if t4 <> 999 then if t4>m then m:=t4; fi; fi;
    od;
    mx:=[op(mx),m];
    od:
    mx;

Extensions

a(12)-a(23) from Indranil Ghosh, Jul 30 2017

A289676 a(n) = A289670(n)/2^f(n), where f(n) = 2*floor((n-1)/3) + ((n+2) mod 3).

Original entry on oeis.org

2, 1, 1, 2, 2, 1, 4, 4, 3, 5, 4, 3, 10, 13, 12, 21, 18, 20, 43, 40, 39, 85, 71, 64, 146, 132, 116, 250, 231, 210, 462, 459, 438, 960, 990, 966, 2069, 2114, 2089, 4296, 4237, 4155, 8485, 8234, 8032, 16496, 16054, 15657, 32041, 31280, 30325, 61700, 60252, 58379, 118357, 115810, 112885
Offset: 1

Views

Author

N. J. A. Sloane, Aug 01 2017

Keywords

Comments

This is the number of distinct binary words w of length n that terminate under the Post tag system (see A284116, A289670) reduced to take into account the observation made by Don Reble that (if the bits of w are labeled from the left starting at bit 0) bits 1,2,4,5,7,8,... (not a multiple of 3) are "junk DNA" and have no effect on the outcome.

Crossrefs

Programs

  • Python
    from _future_ import division
    def A289676(n):
        c, k, r, n2, cs, ts = 0, 1+(n-1)//3, 2**((n-1) % 3), 2**(n-1), set(), set()
        for i in range(2**k):
            j, l = int(bin(i)[2:],8)*r, n2
            traj = set([(l,j)])
            while True:
                if j >= l:
                    j = j*16+13
                    l *= 2
                else:
                    j *= 4
                    l //= 2
                if l == 0:
                    c += 1
                    ts |= traj
                    break
                j %= 2*l
                if (l,j) in traj:
                    cs |= traj
                    break
                if (l,j) in cs:
                    break
                if (l,j) in ts:
                    c += 1
                    break
                traj.add((l,j))
        return c # Chai Wah Wu, Aug 03 2017

Extensions

Corrected by Don Reble, Aug 01 2017 (there were errors in A289670)
Showing 1-10 of 15 results. Next