Solved Problem 16 using BigInteger brute force