Skip to content

Instantly share code, notes, and snippets.

@ytaki0801
Created January 25, 2023 09:00
Show Gist options
  • Save ytaki0801/4c51750380a9b2eafac94bb1ddbe1a6a to your computer and use it in GitHub Desktop.
Save ytaki0801/4c51750380a9b2eafac94bb1ddbe1a6a to your computer and use it in GitHub Desktop.
Collatz-like Sequence on Cyclic Tag System in Python
from time import sleep
q = '100100100100100'
r = {'0':('','','','','','')}
r = {**r, **{'1':('010001','100','100100100','','','')}}
i, m = 0, 6
while q[1:]: q = q[1:]+r[q[0]][i]; i = (i+1)%m; print(q); sleep(0.1)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment