Problem. Two piles; a move removes any number from one pile, or the same number from both. Whoever cannot move loses.

Answer: the losing positions are for , : In each pair the difference is .

bool wythoffLosing(long long a, long long b) {    // P-position iff smaller = floor(k * phi), k = difference
    if (a > b) swap(a, b);
    long long k = b - a, s = sqrtl((long double)5 * k * k);
    while (s * s > 5 * k * k) s--; while ((s + 1) * (s + 1) <= 5 * k * k) s++;
    return a == (k + s) / 2;                      // floor(k * (1 + sqrt 5) / 2)
}