Collatz checks one prime: halve n if 2 divides it, otherwise go to 3n + 1. Here you check more primes before giving up. Divide by the first prime that fits. If none fits, multiply by the next prime and add 1. Every square in the map is a starting number, coloured by the loop it ends in. Click a square to follow its path.
Primes checked
Starting numbersTakes several seconds and a lot of memory. Phones may struggle or reload the page.
Layout
Shading
Hover over a square to see its number.
loop
Close-up
The squares are too small to pick out here, so this close-up follows your pointer over the map. Tap the map to move it, then click a square in the close-up to trace that number.
Path of 27
divide by a primemultiply by the next prime, add 1inside the loop