simple script for the 3n+1 problem give it a nonzero positive integer below the integer limit even = halve it odd = 3n+1 e.g. 3 -> 10 -> 5 -> 16 -> 8 -> 4 -> 2 -> 1 it will eventually reach 1 and return the number of arrows (->) i.e. steps taken, in this case 7 green to restart