Get the latest tech news

Collatz’s Ant


’s Ant is a visualization for collatz sequences based on Langton’s Ant. Additionally to what the collatz function is:\[f(n) = \begin{cases} n/2 & \text{if} \quad n \equiv 0 \quad (\text{mod}\, 2) \\ 3n + 1 & \text{if} \quad n \equiv 1 \quad (\text{mod}\, 2) \\ \end{cases}\] if $n \equiv 0 \, (\text{mod}\, 2)$ the ant turns 90º clockwise, else the ant turns 90º counter-clockwise.

Collatz’s Ant is a visualization for collatz sequences based on Langton’s Ant. \[f(n) = \begin{cases} n/2 & \text{if} \quad n \equiv 0 \quad (\text{mod}\, 2) \\ 3n + 1 & \text{if} \quad n \equiv 1 \quad (\text{mod}\, 2) \\ \end{cases}\] 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.

Get the Android app

Or read this on Hacker News

Read more on:

Photo of Ant

Ant

Photo of Collatz

Collatz