# Takes a tape representing a natural number k (see Boolos, Burgess # and Jeffrey for definition) and returns a tape representing a pair # . 0 1 _ r 1 0 _ _ r 99 1 _ _ r 2 # Look for blank 1 1 1 r 1 2 _ 1 r 3 # Wrote my 1. 2 1 1 r 2 3 _ _ r 4 3 1 _ r 5 4 _ 1 l 6 5 _ 1 r 7 5 1 1 4 5 6 _ _ l 8 6 1 1 l 6 7 _ 1 l 6 8 _ _ l 9 8 1 1 l 8 9 _ _ r 0 9 1 1 l 9 9 1 1 r 1000 # Former halt state. 8 1 1 r 1000 # Former halt state. 7 1 1 r 1000 # Former halt state. 6 1 1 r 1000 # Former halt state. 5 1 1 r 1000 # Former halt state. 4 1 1 r 1000 # Former halt state. 2 1 1 r 1000 # Former halt state. 1 1 1 r 1000 # Former halt state. 99 _ _ r 1000 # Former halt state. 99 1 1 r 1000 # Former halt state. # Skip this block of one's, goto next 100 1 1 r 100 100 _ _ r 101 101 _ _ r 101 101 1 1 l 102 102 _ _ r 103 1000 _ _ l 100 #Goto start state, machine skip 1000 1 1 l 100 #Goto start state, machine skip