int start = 27; System.out.println ("start: " + start); while (x > 1) { if (0 == x % 2) { x = x / 2; } else { x = 3 * x + 1; } System.out.println (x + " "); }