// Here's an open problem: // Start with any number // If it is even, divide by 2 // If it is odd, multiply by 3 and add 1 // Keep doing this // Open question: Do you always end up at 1? import java.util.*; public class OpenProblem { public static void main(String[] args) { Scanner console = new Scanner(System.in); System.out.print("Enter a number: "); int x = console.nextInt(); while (x != 1) { if ((x%2) == 0) { x = x/2; } else { x = 3*x + 1; } System.out.println(x); } } }