private static long trace(long n) {
		long length = 1;
		long temp = n;
		while (temp != 1) {
			length++;
			temp = (temp % 2 == 0) ? (temp / 2) : (3 * temp + 1);
			if (temp < n) {
				try {
					length += l.get(temp);
				} catch (Exception e) {
					System.out.println("tracing " + n + " can't find " + temp);
				}
				break;
			}
		}
		l.put(n, length);
		return length;
	}