public AckermannTable(int n) {
		// construct new table
		table = new Hashtable<Integer, Hashtable<Integer, Integer>>();
		
		// set first value
		int i = 1;
		int j = 2;
		setValue(1, 1, 2);
		
		while (true) {
			int newValue = -1;
			
			// compute next entry
			if (i == 1) {
				newValue = getValue(i, j - 1) * 2;
			} else {
				newValue = getValue(i - 1, getValue(i, j - 1));
			}
			
			if (newValue > n || newValue == -1) {
				if (j == 1) {
					// no single entry in this row - return
					return;
				} else {
					// go to the next row
					i++;
					j = 1;
				}
			} else {
				// save the computed value
				setValue(i, j, newValue);
				j++;
			}
		}
	}