This is Something called the Collatz Conjecture. The rules are that if the number is even, it gets divided by 2. If it's odd, it gets multiplied by 3 and added 1. The graph is to visualize the numbers. Space to start, L to open list of numbers used, k to close it.
Thanks to Lothar Collatz (1910-1990) for introducing the conjecture in 1937.