private static boolean sumsToEigtyNine(int i) {
        if (i == 1) return false;
        if (i == 89) return true;
        
        if (i < 1000) {
            if (one.contains(i)) return false;
            if (eightyNine.contains(i)) return true;
        }
        
        int sum = 0;
        for (char c : (i + "").toCharArray()) {
            int n = (c - '0');
            
            sum += n * n;
        }
        
        boolean subsum = sumsToEigtyNine(sum);
        
        if (i < 1000) {
            (subsum ? eightyNine : one).add(i);
        }
        
        return subsum;
    }