Problem. Nuggets come in packs of and with . What is the largest amount you cannot buy, and how many amounts are impossible?

Answer: the largest is (Sylvester), and there are impossible amounts. With packs the largest impossible amount is .

long long frobenius(long long a, long long b) { return a * b - a - b; }        // gcd(a, b) = 1
long long gapCount(long long a, long long b) { return (a - 1) * (b - 1) / 2; }  // non-representable amounts