Overview
Many competition problems ask, 'given two fixed positive integers, what is the largest integer that cannot be formed using nonnegative multiples of them?' The Chicken McNugget Theorem answers this question completely when the two integers are coprime.
This result is also known as the Frobenius Coin Problem or the Postage Stamp Problem.
Motivation
Suppose a shop sells chicken nuggets only in boxes of and . Which totals can you buy?
Since , you can only ever purchase multiples of , so many totals (like , , , ) are impossible.
Now suppose the box sizes are and . Because , it turns out that every sufficiently large integer can be represented as for nonnegative integers . In fact, once you pass a certain threshold, every number works with no gaps. The natural question is what is the largest integer that cannot be represented?
Theorem Statement
Chicken McNugget Theorem. Let and be positive integers with . Then every integer greater than is representable as (with ), and itself is not. In other words the greatest non representable positive integer is
For example, with and , the largest non representable value is .
Counting Non Representable Values
Under the same hypotheses, the number of positive integers that cannot be represented as is exactly
With there are non representable values.
Proof Outline
We can outline the main ideas behind a proof.
Setup. Call a nonnegative integer representable if for some nonnegative integers .
Step 1: Show is not representable.
Suppose with . Rearranging gives . Since and , we need , so , ie. . Similarly . Then , a contradiction.
Step 2: Show every integer greater than is representable.
The key idea is that once we can hit every residue class modulo using multiples of , adding copies of lets us reach all sufficiently large numbers.
For each residue class modulo , there is a smallest nonnegative number of the form in that class (where ). Any integer in that residue class that is can be written as with . The largest threshold across all residue classes is , so the largest non representable value in any class is at most .
Combining both steps completes the proof.
When
If and are not coprime, set . Then is always a multiple of , so infinitely many positive integers are non representable and no finite 'largest' exists in the usual sense.
However among the multiples of , the largest non representable one is
This follows by applying the coprime theorem to and , then scaling back by .
Worked Examples
Example 1
What is the greatest positive integer that cannot be written as for nonnegative integers ?
Since , the answer is .
Example 2
How many positive integers cannot be expressed as for nonnegative integers ?
Since , the count is .
We can verify, the non representable values are , which is values, and the largest is .
Example 3 (AMC 10B 2015 Problem 15)
The town of Hamlet has people for each horse, sheep for each cow, and ducks for each person. Which of the following could not possibly be the total number of people, horses, sheep, cows, and ducks in Hamlet?
Let be the number of horses and the number of cows. Then the town has people, horses, ducks, cows, and sheep, for a total of .
Since , the largest non representable value is . Therefore .
Some More Insight
For two coprime positive integers and , the value acts as a threshold. Everything above it is representable, while values at or below it may or may not be. In contest problems this means
- If a target value exceeds , it is automatically representable, no further checking is needed.
- You only need to examine values up to the bound to determine which ones fail.
- Many problems reduce to recognising the form and applying the formula directly.
Fast Check Trick
To check whether a specific number is representable as , work modulo the smaller value (say ). Solve for the smallest nonnegative . If , then is representable (set ). Otherwise it is not.
This is often much faster than guessing pairs directly, and it comes up frequently.
Strategy Tips
- Check coprimality first. The theorem only gives a finite answer when . If the gcd is greater than , reduce or use the lcm form.
- Three or more denominations. There is no closed form Frobenius number for three or more values, but you can often reduce the problem. For instance, with denominations , , , since , the pair covers all sufficiently large even numbers, while adding (odd) lets you reach odd numbers too. Casework or systematic checking is usually needed.
- Parity and residues. Thinking in terms of residue classes modulo the smaller value is a great way to organise which totals are achievable.
Common Pitfalls
- Applying the formula when and are not coprime.
- Forgetting that and must be nonnegative (not just any integers).
- Confusing the largest non representable value () with the count of non representable values ().
Practice Problems
| Status | Source | Problem Name | Difficulty | Tags | ||
|---|---|---|---|---|---|---|
| AMC 10B | Hard | Show TagsChicken Mcnugget | ||||
| AIME II | Hard | Show TagsChicken Mcnugget | ||||
| AIME | Hard | Show TagsChicken Mcnugget | ||||
Module Progress:
Join the AoPS Community!
Stuck on a problem, or don't understand a module? Join the AoPS community and get help from other math contest students.
