WHILE X != 1 PRINT X CLEAR A INCREASE A REPEAT X TIMES ( INCREASE A ) IF X on parillinen THEN X = X / 2 ELSE X = 3*X + 1 END WHILE PRINT 1