/* Collatz conjecture */ /* If, odd, increase the number, otherwise, decrease it */ x : 27$ y : [x]$ while x > 1 do ( x : if (mod(x, 2) = 1) then x*3+1 else x/2, y : append(y, [x]) )$ y; print(length(y), " iterations")$