Skip to content

gbragafibra/collatz-ant

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

29 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Collatz's Ant

Visualization for collatz sequences based on Langton's ant.

Additionally to what's the Collatz function($f(n) = n/2$ if $n$ even, else $f(n) = 3n + 1$) if $n$ even, 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$.

Some examples

Example of consecutive trajectories in a single gif (from $n = 10^{30}$ to $n = 10^{30} + 20$).

Keeping count at each coordinate (not flipping state), for corresponding trajectories.

About

Visualization for collatz sequences based on Langton's ant

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages