%I
%S 1,2,11,12,111,112,121,122,1111,1121,1211,1221,2111,2121,2211,2221,
%T 11111,11112,11121,11122,11211,11212,11221,11222,12111,12112,12121,
%U 12122,12211,12212,12221,12222,111111,111112,111121,111122,112111,112112,112121,112122,121111,121112,121121,121122,122111,122112,122121,122122
%N 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.
%C 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.
%C 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.
%C 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.
%C 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".
%D John Stillwell, Elements of Mathematics: From Euclid to Goedel, Princeton, 2016. See page 100, Post's tag system.
%H Rémy Sigrist, <a href="/A289675/b289675.txt">Table of n, a(n) for n = 1..25000</a>
%H Emil L. Post, <a href="http://www.jstor.org/stable/2371809">Formal Reductions of the General Combinatorial Decision Problem</a>, Amer. J. Math. 65, 197215, 1943. See page 204.
%e Working over the more usual alphabet {0,1}, the following are the orbits of the first few words that terminate at the empty word:
%e [0, 1]
%e [1, 01, 0, 1]
%e [00, 0, 1]
%e [01, 0, 1]
%e [000, 00, 0, 1]
%e [001, 00, 0, 1]
%e [010, 00, 0, 1]
%e [011, 00, 0, 1]
%e [0000, 000, 00, 0, 1]
%e [0010, 000, 00, 0, 1]
%e [0100, 000, 00, 0, 1]
%e [0110, 000, 00, 0, 1]
%e [1000, 01101, 0100, 000, 00, 0, 1]
%e [1010, 01101, 0100, 000, 00, 0, 1]
%e [1100, 01101, 0100, 000, 00, 0, 1]
%e [1110, 01101, 0100, 000, 00, 0, 1]
%e [00000, 0000, 000, 00, 0, 1]
%e ...
%e Writing the initial words in this list over {1,2} rather than {0,1} gives the sequence.
%t A289675 = {};
%t Do[For[i = 0, i < 2^n, i++, lst = {};
%t w = IntegerString[i, 2, n];
%t While[! MemberQ[lst, w],
%t AppendTo[lst, w];
%t If[w == "", AppendTo[A289675, IntegerString[i, 2, n]]; Break[]];
%t If[StringTake[w, 1] == "0", w = StringDrop[w <> "00", 3],
%t w = StringDrop[w <> "1101", 3]]]], {n, 6}];
%t Map[StringReplace[#, {"1" > "2", "0" > "1"}] &, A289675]
%t (* _Robert Price_, Sep 26 2019 *)
%Y Cf. A284116, A284119, A284121, A289670, A289671, A289672, A289673, A289674.
%K nonn
%O 1,2
%A _N. J. A. Sloane_, Jul 30 2017
