Figure 6: Emil Post's game of tag

A Post tag system evolves according to a simple rule. At each stage you examine the first (or leftmost) digit of the sequence. If this digit is a 1, then you delete the first three digits and append 1101 to the end of the sequence. Otherwise, if the first digit is a 0, you delete the first three digits and append 00. In the example given here, the sequence quickly falls into a repeating cycle with a period of 2.


The tag rule is captured in the following Scheme procedure, which represents the sequence of digits as a Scheme list. This version of the procedure is too inefficient for large-scale calculations.

(define tag-rule
  (lambda (seq)
    (if (zero? (car seq))
        (append (cdddr seq) '(0 0))
        (append (cdddr seq) '(1 1 0 1)))))

The program I have been running to catalogue tag-system periods is faster but a good deal less perspicuous.