private int grundyValue(int n) {

        switch (n) {
        case  0: return 0;
        case  1: return 0;
        case 15: return 0;
        case 17: return 2;
        case 18: return 2;
        case 32: return 2;
        case 35: return 0;
        case 52: return 2;
        default: return GRUNDY_VALUES[n % 34];
        }
    }