Skip to content

Instantly share code, notes, and snippets.

@ytaki0801
Last active January 25, 2023 09:01
Show Gist options
  • Save ytaki0801/127726db722c59a9d5a0a996cb7b5bab to your computer and use it in GitHub Desktop.
Save ytaki0801/127726db722c59a9d5a0a996cb7b5bab to your computer and use it in GitHub Desktop.
Collatz-like Sequence on Cyclic Tag System in POSIX Shell
Q=100100100100100
S=000001010011100101
R0001=010001; R0011=100; R0101=100100100
while [ ${Q#?} ]; do
eval Q=${Q#?}\$R${S%${S#???}}${Q%${Q#?}}
S=${S#???}${S%${S#???}}
echo $Q
sleep 0.1
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment