collatzCA

View on GitHub

Collatz Cellular Automata

collatz CA

This cellular automaton is also a map of the Collatz conjecture.

The Collatz conjecture says that if you start with any positive integer and if the number is even, divide it by two and if the number is odd, triple it and add one, you will eventually reach one. Some numbers take longer than others to get to one as they grow to very large numbers.

In this visualization large numbers are red cells. Smaller numbers are cooler colors like greens and blues. Black cells have reached one. At the start, the cells are randomly seeded with a number between 7 and 255.

Just as an example 255 takes 48 steps to get to 1 and it reaches a height of 13120.

When all the cells have reached one the cells are reseeded. The cell sizes can be changed. Large fields of smalls cells look like living colonies.

Large Field

Small fields of larges cells look like some type of alien communication. #creativecoding #collatzconjecture #processing #proceduralart #P5js

Small Field

Home