Blogs / Personal blogs

Universal Miscellany

gbragafibra.github.io

Popular posts
2
Total points
216
HN comments
31
Rank
#11,959 personal

Visit gbragafibra.github.io → On Hacker News Dec 2024 – Apr 2025

Math & Algorithms 2

1

Collatz’s Ant

if $n \equiv 0 \, (\text{mod}\, 2)$ the ant turns 90º clockwise, else the ant turns 90º counter-clockwise. On both accounts, the state of the cell is flipped and the ant moves forward one unit. This is repeated until $n = 1$.