Skip to content

Instantly share code, notes, and snippets.

@lengyijun
Created November 14, 2024 00:32
Show Gist options
  • Save lengyijun/619f633938964cc24c4b0fbb5a8cbc63 to your computer and use it in GitHub Desktop.
Save lengyijun/619f633938964cc24c4b0fbb5a8cbc63 to your computer and use it in GitHub Desktop.
; https://terrytao.wordpress.com/2011/08/25/the-collatz-conjecture-littlewood-offord-theory-and-powers-of-2-and-3/
blank_symbol: #
initial_state: bootstrap_stage_1
bootstrap_stage_1
# 1 R bootstrap_stage_2
0 0 R unreachable
1 1 R unreachable
bootstrap_stage_2
# 0 L cp_twice_stage_1
1 1 L unreachable
0 0 L unreachable
even
1 1 R odd
# # L divide_2_stage_1
0 0 L unreachable
odd
1 1 R even
# # L cp_twice_stage_1
0 0 L unreachable
divide_2_stage_1
1 # L divide_2_stage_2
0 0 L init_pointer_stage_1
# # L unreachable
divide_2_stage_2
1 1 L divide_2_stage_2
0 1 R divide_2_stage_3
# # R divide_2_stage_3
divide_2_stage_3
1 0 R divide_2_stage_4
# # R unreachable
0 0 R unreachable
divide_2_stage_4
1 1 R divide_2_stage_4
# # L divide_2_stage_1
0 0 L unreachable
cp_twice_stage_1
1 1 L cp_twice_stage_1
# # R cp_twice_stage_2
0 1 R cp_twice_stage_2
cp_twice_stage_2
1 0 R cp_twice_stage_3
0 # R even
# 1 R update_visited_stage_1 ; 3n+1
cp_twice_stage_3
1 1 R cp_twice_stage_3
0 0 R cp_twice_stage_4
# # R cp_twice_stage_4
cp_twice_stage_4
1 1 R cp_twice_stage_4
# 1 R cp_twice_stage_6
0 0 L unreachable
cp_twice_stage_5
1 1 L cp_twice_stage_5
# # L cp_twice_stage_1
0 0 L cp_twice_stage_1
cp_twice_stage_6
# 1 L cp_twice_stage_5
0 0 L unreachable
1 1 L unreachable
; goto rightest, set 0
update_visited_stage_1
0 0 R unreachable
1 1 R update_visited_stage_1
# # L update_visited_stage_2
update_visited_stage_2
1 0 L init_pointer_stage_1
# # L unreachable
0 0 L unreachable
init_pointer_stage_1
1 1 L init_pointer_stage_1
# # L init_pointer_stage_2
0 0 L unreachable
init_pointer_stage_2
1 1 L init_pointer_stage_2
# # L init_pointer_stage_3
0 0 L unreachable
init_pointer_stage_3
# # R origin_0_stage_1
0 # R origin_0_stage_1
1 # R origin_1_stage_1
origin_0_stage_1
# # R origin_0_stage_2
0 0 R origin_0_stage_1
1 1 R origin_0_stage_1
origin_0_stage_2
1 1 R origin_0_stage_2
# # R origin_0_stage_3
0 0 R unreachable
origin_0_stage_3
1 1 R origin_0_stage_3
0 1 L origin_0_stage_4
# # L unreachable
origin_0_stage_4
1 0 L origin_0_stage_5
0 0 L unreachable
# # L finish_0_stage_1
origin_0_stage_5
1 1 L origin_0_stage_5
0 0 L unreachable
# # L origin_0_stage_6
origin_0_stage_6
1 1 L origin_0_stage_6
0 0 L unreachable
# # L origin_0_stage_7
origin_0_stage_7
1 1 L origin_0_stage_7
0 0 L origin_0_stage_7
# 0 L init_pointer_stage_3
finish_0_stage_1
0 0 L unreachable
1 1 L finish_0_stage_1
# # L finish_0_stage_2
finish_0_stage_2
0 0 L finish_0_stage_2
1 1 L finish_0_stage_2
# 1 R check_1
origin_1_stage_1
# # R origin_1_stage_2
0 0 R origin_1_stage_1
1 1 R origin_1_stage_1
origin_1_stage_2
1 1 R origin_1_stage_2
# # R origin_1_stage_3
0 0 R unreachable
origin_1_stage_3
1 1 R origin_1_stage_3
0 1 L origin_1_stage_4
# # L unreachable
origin_1_stage_4
1 0 L origin_1_stage_5
0 0 L unreachable
# HALT
origin_1_stage_5
1 1 L origin_1_stage_5
0 0 L unreachable
# # L origin_1_stage_6
origin_1_stage_6
1 1 L origin_1_stage_6
0 0 L unreachable
# # L origin_1_stage_7
origin_1_stage_7
1 1 L origin_1_stage_7
0 0 L origin_1_stage_7
# 1 L init_pointer_stage_3
check_1
# # L cleanup_visited
0 0 R continue_collatz_stage_1
1 1 R continue_collatz_stage_1
continue_collatz_stage_1
# # R continue_collatz_stage_2
0 0 R continue_collatz_stage_1
1 1 R continue_collatz_stage_1
continue_collatz_stage_2
1 1 R continue_collatz_stage_2
0 0 R unreachable
# # R even
cleanup_visited
0 # L cleanup_visited
1 # L cleanup_visited
# # R plus_1_stage_1
plus_1_stage_1
# # R plus_1_stage_1
1 1 R plus_1_stage_2
0 0 R unreachable
plus_1_stage_2
1 1 R plus_1_stage_2
# 1 R plus_1_stage_3
0 0 R unreachable
plus_1_stage_3
1 1 R plus_1_stage_3
# 0 L cp_twice_stage_1
0 0 L unreachable
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment