@@ -0,0 +1,1017 @@
+import java.util.LinkedList;%0Aimport java.util.List;%0A%0A/**%0A * @author David Clutter%0A */%0Apublic class Problem0014 %7B%0A%0A    public static void main(final String%5B%5D args) %7B%0A        long startingNumber = 0;%0A        int collatzSize = 0;%0A        for (int i = 2; i %3C 1_000_000; ++i) %7B%0A            final int currentCollatzSize = collatzList(i).size();%0A            if (currentCollatzSize %3E collatzSize) %7B%0A                collatzSize = currentCollatzSize;%0A                startingNumber = i;%0A            %7D%0A        %7D%0A        System.out.println(startingNumber);%0A    %7D%0A%0A%0A    private static List%3CLong%3E collatzList(final long number) %7B%0A        final List%3CLong%3E collatzList = new LinkedList%3C%3E();%0A        collatzList.add(number);%0A        long current = number;%0A        while (current != 1) %7B%0A            current = collatz(current);%0A            collatzList.add(current);%0A        %7D%0A        return collatzList;%0A    %7D%0A%0A    private static long collatz(final long number) %7B%0A        return (number & 1) == 0 ? number / 2 : 3 * number + 1;%0A    %7D%0A%7D

Add Problem0014