Learn the idea. Try it yourself.
Read the explanation or try 6 questions with hints. Free, untimed and no sign-in needed.
All lessons · Albania study route · Start adaptive practice
Your goal: Decide which totals can be built from fixed-size groups, find every permitted combination, and prove when all sufficiently large totals become possible. A successful search finds an example; a complete argument also explains what your search cannot have missed.
Preparation context: This original lesson develops integer-combination reasoning for Albania’s AMU first-stage mathematics preparation, with separately labelled proof extensions. The AMA archive’s released 2025–26 AMU first-stage collection contains integer-payment reasoning. Its local papers supply historical topic context; this lesson does not claim a uniform current exam format, reproduce an official question, or predict a future question.
Study plan: Allow two 25–35 minute sittings. Use the first for the diagnostic and Examples 1–2, and the second for Examples 3–4. Reserve further study sessions for the nine written transfer problems and return to them without hints after a break. The general threshold proof is a stretch extension: complete the concrete five-in-a-row proof first. Prerequisites are integer arithmetic, simple equations, divisibility, GCD and coprimality, and remainders.
Three starting checks
nonnegative integer is 0, 1, 2, 3, … . Zero is allowed; negative values and fractions are not. A pair (x, y) is ordered: x counts the first type of group and y the second. Throughout this lesson a and b are positive integer group sizes.
Check 1. Read the domain
Is a nonnegative integer solution of ?
Complete solution
Substitution gives , so it is an integer solution. But is negative, so it is not a nonnegative integer solution. In a packing problem it would require removing a group that was never available. Satisfying the equation is only one of the conditions.
Check 2. Spot a common-divisor obstruction
Can equal 35 for integers x and y?
Complete solution
Both 6x and 10y are even, including when x or y is negative. Their sum is even, whereas 35 is odd. Therefore no integer solution exists, and in particular no nonnegative one exists. This is a proof of impossibility, not merely an unsuccessful search.
Check 3. Use a remainder to shorten a list
If y is a nonnegative integer, , and y leaves remainder 2 on division by 3, list every possible y.
Complete solution
Starting at 2 and adding 3 gives 2, 5, 8. The next value 11 exceeds the bound. Equivalently for an integer t, and the inequalities allow exactly . The bound makes the list complete.
If Check 1 was difficult, write the allowed domain beside each equation. If Check 2 was difficult, revisit divisibility. If Check 3 was difficult, practise listing one remainder class before trying to count combinations.
An equation describes a total; inequalities describe what is allowed
Suppose x groups each contain a objects and y groups each contain b objects. To make a total N, we need , with x and y nonnegative integers. We assume an unlimited supply of both group types unless the problem gives a limit. The order in which the groups are used does not create a new pair (x, y).
A necessary first check is divides N. If g divides a and b, then and for integers r and s, so is a multiple of g. If g does not divide N, stop: there is no solution. If it does, divide the whole equation by g. This removes the common factor without changing x or y.
Passing this check is not enough for nonnegative solutions. For example, divides 3, and . Yet 3 cannot be formed from nonnegative numbers of 4s and 7s: using any group gives at least 4. An integer combination may use subtraction; a nonnegative combination may not.
Choose a remainder, then impose a bound
From , reduce both sides modulo a. This means compare their remainders after division by a. The term ax has remainder zero, so . The symbol means that the two sides have the same remainder. First find the allowed remainders of y; then use to bound y. For each surviving y, calculate and check that it is a nonnegative integer.
Why is this complete? Every valid solution must satisfy both the remainder condition and the bound. Listing every y that satisfies them, then checking x, leaves no other possibility. Do not divide a congruence by a common factor without checking the modulus: for example, allows all odd y, not only .
Four connected worked examples
Example 1. Reduce first, then find every combination
A workshop uses complete bundles of 6 or 9 rods. Find all ways to obtain exactly 63 rods, recording the number of each bundle size.
Set up. Let x count 6-rod bundles and y count 9-rod bundles. Then . Divide by their common factor 3 to obtain . We still require and both integers.
Use parity. The term 2x is even. Since 21 is odd and 3y has the same parity as y, y must be odd. Also , so . Thus y is 1, 3, 5 or 7.
Recover and check x. Using gives , , , . Substituting into gives 63 in every case. The pair (0, 7) is allowed because a zero count is permitted. Every bounded odd y has been checked, so these four ways are all the possibilities.
Your turn 1. Keep zero counts in the list
Find every nonnegative integer solution of .
Hint 1
Remove the common factor of the two coefficients.
Hint 2
In , what parity and upper bound must y have?
Complete solution
Divide by 4 to obtain . Thus y is odd and , so . Substitution gives , , . Each makes the original total 60. There are no further solutions because the complete bounded list of odd values of y has been used.
Why solutions come in regular steps
For coprime a and b, suppose one integer solution is . Any other solution satisfies . Since a and b share no prime factor, a must divide : every prime factor required by a must come from this difference, not from b. Write for an integer t. Substitution then gives .
Consequently every integer solution has the form , , for an integer t. Conversely, substituting these expressions gives , so every such pair preserves the total. Nonnegativity restricts the allowed values of t.
This step replaces b groups of size a by a groups of size b; both collections contain ab objects. If the original coefficients had GCD g, first divide them by g. The step then uses a/g and b/g, rather than a and b. This is a description of all solutions, not a claim that all integer values of t are physically feasible.
Example 2. Optimise only after making the complete list
A club needs 160 counters. Counters come in sealed packs of 7 or 11. What is the least number of packs that makes the exact total?
Represent the two pack types. Let x count 7-packs and y count 11-packs. We need , with x, y nonnegative integers. Reducing modulo 7 gives . Multiplying by 2 gives , or , because 8 and 1 have the same remainder modulo 7.
Bound and enumerate. Since . Thus y is 5 or 12. These give or 4, respectively. The only possible pairs are (15, 5) and (4, 12), using 20 and 16 packs.
Conclude the minimum. The least number is 16 packs, achieved by four 7-packs and twelve 11-packs: . The exchange step replaces eleven 7-packs by seven 11-packs, reducing the pack count by four. Taking as many larger packs as possible without checking the remainder would be unsafe: fourteen 11-packs leave 6 counters, which no 7-pack can supply.
Your turn 2. Add a limit on the number of packs
Find every nonnegative integer pair (x, y) satisfying and .
Hint 1
Begin with the same remainder condition as Example 2.
Hint 2
List within the new upper bound, then apply .
Complete solution
Modulo 7, we get , so . Since or 12. The pairs are (19, 5) and (8, 12), with total pack counts 24 and 20. Only (8, 12) meets the limit of 21 packs. It gives and uses 20 packs. Applying the extra limit after the complete list ensures that no feasible pair is missed.
Example 3. Prove a permanent threshold
A strip may be assembled from pieces of length 5 or 8 units, with no cutting and no overlap. Prove that every integer length at least 28 is possible, and that 27 is not.
A finite check can support an infinite proof. Adding one 5-unit piece to an obtainable length gives another obtainable length. Therefore it is enough to make five consecutive lengths: every larger length can be reached from one of them by adding enough 5s.
| Length | A construction |
|---|---|
| 28 | |
| 29 | |
| 30 | |
| 31 | |
| 32 |
Given any integer , divide by 5: , where and r is one of 0, 1, 2, 3, 4. The table constructs . Add q more 5-unit pieces to obtain N. This explains why the finite table covers every larger integer.
Check the boundary. If , then . Modulo 5, , so , since the remainders of 3y for are 0, 3, 1, 4, 2. No y from 0 through 3 works. Therefore 27 is impossible, and 28 is the smallest threshold above which every length is possible.
Your turn 3. Explain why four checks are enough
Using lengths 4 and 7, prove that every integer length at least 18 is possible and 17 is not.
Hint 1
Make four consecutive totals, then keep adding 4.
Hint 2
Check 18, 19, 20, 21. For the obstruction, bound y before using remainders.
Complete solution
The four consecutive lengths are , , , and . For , division gives with and . Construct and add q pieces of length 4.
If , then . Modulo 4 the equation gives , hence ; none of 0, 1, 2 has this remainder. Thus 17 is impossible. The exact threshold is 18.
Stretch bridge: the two-size threshold theorem
The previous example suggests a general question. Let a and b be coprime integers greater than 1. The largest integer that cannot be written as with x, y nonnegative integers is . Equivalently, every integer is obtainable, and the preceding integer is not. This standard result is often called the two-coin or Frobenius theorem. Here is a proof, so the formula need not be memorised without a reason.
Part 1: one representative for each remainder
Consider modulo a. No two have the same remainder. If ib and jb did, a would divide . Coprimality implies that a divides . But for distinct i, j between 0 and , the absolute difference is positive and less than a, so it cannot be a multiple of a. There are a different remainders in a list of a terms; therefore every remainder 0 through occurs exactly once.
For any , choose y from 0 through such that by has the same remainder as N. Then is a multiple of a. Also
.
The negative multiples of a are . None lies between and . Hence the multiple must be nonnegative. Set . Both x and y are nonnegative integers and . This proves the guarantee for every N in the stated range.
Part 2: prove that the preceding integer fails
Suppose, contrary to the claim, that for nonnegative integers x, y. Add to get . Reducing modulo a shows a divides , so a divides . As is positive, it is at least a. Thus , while is also positive. Their sum would exceed ab, a contradiction. The boundary is therefore unattainable.
Conditions matter. If a and b have a common factor greater than 1, infinitely many integers are impossible, so there is no largest impossible integer among all integers. Divide by the GCD and ask about multiples of that GCD instead. If a or b equals 1, every nonnegative total is possible; the “largest impossible positive total” question then has no answer.
Example 4. A lower bound shifts the threshold
A display must use at least two 6-unit pieces and at least one 11-unit piece. What is the largest integer total that cannot be made under these conditions?
Reserve the compulsory pieces first. Write and , where u, v are nonnegative integers. Then . The minimum compulsory contribution is 23; the remaining total must be a nonnegative combination of 6 and 11.
Apply the proved theorem to the remainder. The sizes 6 and 11 are coprime and greater than 1. Their largest unobtainable remainder is , and every remainder at least 50 is obtainable. Thus is impossible under the original conditions, while every integer total at least is possible.
Check both directions. A construction for the remaining total gives a valid display after adding the compulsory pieces. Conversely, any valid display loses exactly those pieces and gives a nonnegative representation of its remainder. Therefore the shift neither loses nor invents solutions, and 72 is the largest impossible total.
Your turn 4. Shift two different lower bounds
Find the largest integer N that cannot equal when and are integers.
Hint 1
Remove one 5-unit group and two 8-unit groups before asking about reachability.
Hint 2
Their total is 21. Apply the exact result for .
Complete solution
Set , with . Then . Example 3 proves that 27 is the largest impossible remainder and every remainder at least 28 is obtainable. Hence is impossible, and every is possible. The substitution is reversible, so this answers the original constrained problem.
Choose the method for a new problem
- One specified total: use a GCD obstruction, one remainder class and a finite bound.
- All combinations or an optimum: prove the complete list or exchange-step formula before comparing candidates.
- Every sufficiently large total: construct a consecutive block, or prove the coprime two-size theorem applies.
- Compulsory minimum counts: reserve those groups and substitute nonnegative remaining counts.
- A parity or count condition: translate it into the variables. Do not assume it follows from the total equation.
- Three group sizes: the two-size formula does not apply unchanged. Bound one count or prove a new consecutive block.
Mistakes worth catching early
- Allowing a negative count because it satisfies the equation. Check the domain after every calculation.
- Stopping after finding one construction. “Find all” needs an exhaustive bound or parametrisation.
- Using the GCD test as proof of nonnegative feasibility. It is an obstruction test, not a complete answer for small totals.
- Making an arbitrary finite table and claiming all larger totals work. Explain the add-a-group step and cover every remainder.
- Confusing the largest impossible total with the first permanently possible total. These differ by one.
- Using when a and b are not coprime, or applying it unchanged to three sizes.
- Optimising by always choosing the largest group. The remainder may make that choice impossible.
- Forgetting that a lower bound or even-count requirement changes the available combinations.
Nine original written problems
Problems 1–2 establish a complete search; 3–6 add meaningful constraints; 7–9 are proof extensions. The levels describe this lesson’s progression, not an official marking scale. Try each problem before opening its hints.
Foundation · 1. Stop an impossible search
Can have a nonnegative integer solution? Prove your answer.
Hint 1
Find a common divisor of both group sizes.
Hint 2
Check whether the total has that divisor.
Complete solution
Both terms on the left are divisible by 4, so their sum must be divisible by 4. But 50 leaves remainder 2 on division by 4. Thus there is no integer solution, and therefore no nonnegative integer solution. This argument excludes all possibilities without listing them.
Foundation · 2. A complete list
Find all nonnegative integer pairs (x, y) for which .
Hint 1
Reduce the equation modulo 4.
Hint 2
Use both and .
Complete solution
Modulo 4, we have because and . The inequality gives . Thus y is 1, 5 or 9, and gives (19, 1), (10, 5), (1, 9). Each pair gives total 85 and has nonnegative integer entries. Every y in the required remainder class and range has been considered, so these are all solutions.
Core · 3. An even number of groups
A total of 101 objects is packed into groups of 5 or 8. Find every packing that uses an even total number of groups.
Hint 1
First find all packings without the even-count condition.
Hint 2
The possible y values are 2, 7, 12. Check for each.
Complete solution
Let x and y count the two group sizes. Modulo 5, , so , because . Also . Thus , giving , , . Their group counts are 19, 16, 13. Only (9, 7) uses an even count. It gives and uses 16 groups. The complete remainder list excludes all other packings.
Core · 4. Noncoprime sizes and a minimum
Find all nonnegative integer pairs satisfying , then determine the smallest possible value of .
Hint 1
Remove the GCD before taking remainders.
Hint 2
After division, bound y and solve .
Complete solution
Divide by 2 to get . Modulo 3, , so . Since , the possibilities are 2, 5, 8. They give , , , whose sums are 15, 13, 11. Thus the minimum is 11, attained at (3, 8). All three pairs satisfy the original equation. The range and remainder argument makes the list exhaustive.
Core · 5. Both types must be used
Find every pair of positive integers x, y for which .
Hint 1
A positive count differs from a nonnegative count at the boundary.
Hint 2
Reduce modulo 9 and bound the positive value of y.
Complete solution
Modulo 9, . Since 5 and 9 are coprime, y is divisible by 9. Positivity and give , so . It yields , and . Thus the only positive pair is (6, 9). The pair (20, 0) satisfies the total equation but is excluded by the requirement .
Core · 6. An infinite obstruction and a finite one
Using nonnegative numbers of groups of sizes 6 and 10, explain why there is no largest impossible integer total. Then find the largest impossible even total.
Hint 1
Separate odd totals from even totals.
Hint 2
For an even total write and reduce to sizes 3 and 5.
Complete solution
Every odd total is impossible because both sizes are even, so impossible integer totals extend without bound. For an even total , the equation is equivalent to . The sizes 3 and 5 are coprime. The theorem gives largest impossible ; every works. Hence the largest impossible even N is 14, and every even works. Multiplying or dividing by 2 preserves the counts x, y.
Proof extension · 7. A third group size
Prove that 43 is the largest integer that cannot be written as with x, y, z nonnegative integers.
Hint 1
Look for a block of six consecutive obtainable totals.
Hint 2
Construct 44 through 49; for 43 test .
Complete solution
First construct six consecutive totals: ; ; ; ; ; . For any , write with and . Construct from the list and add q groups of size 6. Thus every works. To test 43, we have . If or 1, the remainder 43 or 23 is not divisible by 3, whereas always is. If , the remainder is 3, smaller than either positive group size 6 or 9; instead gives zero. No case works. Therefore 43 is impossible and is the largest such total.
Proof extension · 8. Why small totals have at most one representation
Let a and b be coprime integers greater than 1. Prove that each integer N with has at most one nonnegative integer representation . Show that has exactly two such representations.
Hint 1
Compare two hypothetical solutions and use the exchange-step argument.
Hint 2
Below ab, y lies between 0 and . At ab the endpoints and become available.
Complete solution
For a representation below , implies , and implies . If two pairs and gave the same N, then . Coprimality implies a divides . Both y-values lie between 0 and , so their difference has absolute value less than a; the only divisible possibility is zero. Thus , and the equation gives . This proves at most one representation, not existence. For , reducing modulo a shows a divides y. The bound then leaves or a, giving exactly and (0, a). Both satisfy the equation.
Proof extension · 9. A parity condition changes the sizes
Find the largest integer N that cannot equal when x and y are integers, is even, and . Prove the permanent threshold as well.
Hint 1
Build the even-count requirement into a substitution instead of testing it afterwards.
Hint 2
Use and . What are the new sizes and compulsory total?
Complete solution
Because x is even and at least 2, write with an integer. Write with . The total becomes . Conversely, every nonnegative pair u, v gives counts with the stated parity and lower bounds. The remaining sizes 8 and 7 are coprime, so their largest impossible remainder is , while all remainders at least 42 are obtainable. Thus is impossible, and every is obtainable. The reversible substitution proves that 56 is the largest impossible total for the original problem.
A proof rubric for self-review
This checklist is editorial guidance, not an official marking scheme and not automatic proof grading.
- Model: Define what each count means, its integer domain, and every lower bound, upper bound or parity requirement.
- Necessary conditions: Justify the GCD or remainder restriction. Show that every solution must enter your list or parametrisation.
- Completeness: State a finite bound, prove the exchange step, or explain how a consecutive block covers every later remainder.
- Verification: Substitute each proposed pair into the original total and constraints. For a threshold, prove both that the boundary fails and that all later totals work.
- Conclusion: Answer the exact demand: a construction, all combinations, a minimum, or a largest impossible total.
Finding one pair proves existence. A GCD obstruction proves impossibility. A complete parameter list proves “all”. A threshold needs a guarantee and an obstruction. Do not swap one kind of evidence for another.
Adaptive checks: select the next step
These objective questions test domains, remainders, exhaustive counts, minimum group counts and threshold reasoning. The practice adjusts the level from your responses and supplies hints and links back to the relevant explanation. An arbitrary written proof is not automatically graded.
A complete session means six responses, including requested solutions. It does not mean six independently correct answers or mastery. Revisit assisted work later without the explanation. All learning remains free, and the site’s existing privacy and optional browser-local progress choices still apply.
Interactive practice loads here. You can also use the complete question set below.
Explain the method before returning to a paper
Choose one problem you solved with help. Close the solution and explain why the remainder condition, the bound and the candidate check are all needed. For a threshold problem, explain why your finite check proves an infinite claim. Then attempt the problem again independently.
Return to Albania’s study and paper route · Repair a remainder prerequisite · Review GCD · Choose another lesson
Preparation sources and original work
The AMA 2025–26 AMU first-stage collection is linked for historical topic and level context. Consult the Albanian Mathematical Association’s competition overview and the current organiser instructions for the actual competition route and rules.
The mathematical results are standard; all explanations, worked examples and practice problems here are original IMOolympiad.com teaching material. No official problem is reproduced, translated or numerically adapted. This independent educational site is not an organiser and does not claim endorsement or affiliation. Preparation context checked 2 November 2026.