# Set I, the number of iterations, to 196 INCREASE W INCREASE W INCREASE W INCREASE W INCREASE W INCREASE W INCREASE W INCREASE W INCREASE W INCREASE W INCREASE W INCREASE W INCREASE W INCREASE W REPEAT W TIMES ( REPEAT W TIMES ( INCREASE I # Increase to 14^2 = 196 ) ) # Set M to 3 INCREASE M INCREASE M INCREASE M PRINT X REPEAT I TIMES ( ## Set P = 1 if X > 1 ## REPEAT X TIMES ( # X-1 REPEAT N TIMES ( INCREASE L ) CLEAR N INCREASE N ) CLEAR N REPEAT L TIMES ( CLEAR P INCREASE P ) CLEAR L ######################### REPEAT P TIMES ( # Check if X is even (then E=1 and O=0) Z = X/2 INCREASE E REPEAT X TIMES ( REPEAT O TIMES ( INCREASE T ) CLEAR O REPEAT E TIMES ( INCREASE O ) CLEAR E REPEAT T TIMES ( INCREASE E ) REPEAT T TIMES ( INCREASE Z ) CLEAR T ) # If X is even, make Z be X/2 REPEAT E TIMES ( # Set X to be Z CLEAR X REPEAT Z TIMES ( INCREASE X ) ) # If X is odd, make X be 3*X+1 (X+2X+1) REPEAT O TIMES ( REPEAT X TIMES ( REPEAT M TIMES ( INCREASE J ) ) INCREASE J PRINT J CLEAR J REPEAT Z TIMES ( INCREASE X ) INCREASE X ) CLEAR Z CLEAR E CLEAR O PRINT X ) CLEAR P )