How many steps???
This is the "3 n + 1" game".
Enter a number n:
- if it is even, n/2 is produced, otherwise 3*n + 1;
- repeat taking this number as the new n;
- proceed similarly until you get to 1.
The number of steps to get to 1 is printed.
How many steps?
Try e.g. with 101, 1001, 31, 1000000000, 123456.
It has not yet been shown that in any case the process ends!!!