public static void main(String[] args){
		HashMap<BigInteger, Integer> cache = new HashMap<BigInteger, Integer>();	//memoiation structure that has the key of the integer, and the value of the length it takes to get to 1 according to the sequence
		cache.put(BigInteger.valueOf(1), 1);
		cache.put(BigInteger.valueOf(2), 2);
//		cache.put(BigInteger.valueOf(-1), 2); //-1 is the temp
		
		Integer largest = 2;	//current longest chain
		BigInteger num = BigInteger.valueOf(2);	//current longest chain starts with 2
		
		for(int i = 3; i<1000000; i = i + 2){
			//	if it is in the map, get the length and test
			if(cache.containsKey(BigInteger.valueOf(i))){
				if(largest < cache.get(BigInteger.valueOf(i))){	//new longest
					largest = cache.get(BigInteger.valueOf(i));
					num = BigInteger.valueOf(i);
				}
			}
			//not in the map yet
			else{
				cache = getLength(BigInteger.valueOf(i), cache);
				if(largest < cache.get(BigInteger.valueOf(i))){	//new longest
					largest = cache.get(BigInteger.valueOf(i));
					num = BigInteger.valueOf(i);
				}
			}
			
			System.out.println(i + ": largest length so far = " + largest);
			
		}
		
		System.out.println("ANSWER: " + largest + " by: " + num);//answer
	}