import java.util.Random; public class Choice { public static void main(String[] args) { int depth = Integer.parseInt(args[0]); Choice.make(depth, 1); } private static void make(int depth, int value) { if (depth != 0) { Random random = new Random(); if (random.nextBoolean()) { Choice.make(depth - 1, 2 * value - 1); } else { Choice.make(depth - 1, 2 * value); } } else { System.out.println(value); } } }