# Commands: # CLEAR X # INCREASE X # PRINT X # REPEAT X TIMES ( ... ) # Longest Collatz conjecture: 113 (somewhere) # Max amount to A (unpacked; currently 113) INCREASE A INCREASE A INCREASE A INCREASE A INCREASE A INCREASE A INCREASE A INCREASE A INCREASE A INCREASE A INCREASE A INCREASE A INCREASE A INCREASE A INCREASE A INCREASE A INCREASE A INCREASE A INCREASE A INCREASE A INCREASE A INCREASE A INCREASE A INCREASE A INCREASE A INCREASE A INCREASE A INCREASE A INCREASE A INCREASE A INCREASE A INCREASE A INCREASE A INCREASE A INCREASE A INCREASE A INCREASE A INCREASE A INCREASE A INCREASE A INCREASE A INCREASE A INCREASE A INCREASE A INCREASE A INCREASE A INCREASE A INCREASE A INCREASE A INCREASE A INCREASE A INCREASE A INCREASE A INCREASE A INCREASE A INCREASE A INCREASE A INCREASE A INCREASE A INCREASE A INCREASE A INCREASE A INCREASE A INCREASE A INCREASE A INCREASE A INCREASE A INCREASE A INCREASE A INCREASE A INCREASE A INCREASE A INCREASE A INCREASE A INCREASE A INCREASE A INCREASE A INCREASE A INCREASE A INCREASE A INCREASE A INCREASE A INCREASE A INCREASE A INCREASE A INCREASE A INCREASE A INCREASE A INCREASE A INCREASE A INCREASE A INCREASE A INCREASE A INCREASE A INCREASE A INCREASE A INCREASE A INCREASE A INCREASE A INCREASE A INCREASE A INCREASE A INCREASE A INCREASE A INCREASE A INCREASE A INCREASE A INCREASE A INCREASE A INCREASE A INCREASE A INCREASE A INCREASE A PRINT X # Start the conjecture INCREASE C # Will be nuked when reaches 1 (and if already 1) INCREASE K REPEAT X TIMES ( REPEAT K TIMES ( REPEAT M TIMES ( INCREASE N ) INCREASE M REPEAT N TIMES ( CLEAR K # Loop will break ) ) ) REPEAT K TIMES ( # If loop went through (stopped at 1) CLEAR C ) REPEAT X TIMES ( # Is the first number odd? INCREASE P REPEAT O TIMES ( CLEAR O CLEAR P ) REPEAT P TIMES ( INCREASE O ) ) REPEAT A TIMES ( REPEAT C TIMES ( # Continue if hasn't reached 1 # CLEAR O # CLEAR P # REPEAT X TIMES ( # Is odd? # INCREASE P # REPEAT O TIMES ( # CLEAR O # CLEAR P # ) # REPEAT P TIMES ( # INCREASE O # ) # ) REPEAT O TIMES ( # Multiply and increment if odd REPEAT X TIMES ( INCREASE Y INCREASE Y INCREASE Y ) INCREASE Y PRINT Y CLEAR X ) REPEAT X TIMES ( # Clone to Y if necessary INCREASE Y ) CLEAR X CLEAR D CLEAR E CLEAR O CLEAR P REPEAT Y TIMES ( # Divide by 2 INCREASE E REPEAT D TIMES ( INCREASE X CLEAR D CLEAR E INCREASE P # Check oddness (oddity? oddfulness??) concurrently REPEAT O TIMES ( CLEAR O CLEAR P ) REPEAT P TIMES ( INCREASE O ) ) REPEAT E TIMES ( INCREASE D ) ) PRINT X # Clean up CLEAR Y # Stop if 1 (Clear C) INCREASE V REPEAT X TIMES ( REPEAT V TIMES ( REPEAT Z TIMES ( INCREASE W ) INCREASE Z REPEAT W TIMES ( CLEAR V # Loop will break CLEAR W # Clear everything else if continuing CLEAR Z ) ) ) REPEAT V TIMES ( # If loop went through (stopped at 1) CLEAR C ) ) )