HelpContactFor teachers and institutes
>_StemPy Lab
Mock TestsClasses

>_StemPy Lab

Learn. Solve. Code the solutions. Test yourself.

Live examsFree mock exams, timed and rankedEveryone starts together, and your score and rank come the moment it ends.See the exams →
Live examsInternational live exams are comingTell us which exam you want first. Timed practice papers are open now.See what is coming →

Learn

  • Physics
  • Chemistry
  • Mathematics
  • Biology
  • Python Programming
  • Statistics & Data Science
  • Computer Science
  • Space Science and Astronomy
  • Classes
  • Groups

Practice

  • Problems
  • Quizzes
  • Mock Tests
  • Prepare for an Exam
  • Question Sets
  • Exams
  • Certificates
  • Python Labs
  • AI Practice Generator
  • Student-Created Tests

Community

  • Discussions
  • Resources
  • Notes
  • Glossary
  • Blog

Account

  • Log in
© 2026 senLearn. All rights reserved.HelpFor SchoolsAboutContactPrivacy PolicyTerms of UseRefund Policy
  1. Problems
  2. /Stamps come in values of 5 units and 8 units…
AdvancedMathematicsHigh School (11–12)Number TheoryproofNumericalOlympiad

Stamps come in values of 5 units and 8 units…

StemPy LabContributed by StemPy Lab

Try it on paper first. A hint, the key idea and the worked solution are here when you need them.

Stamps come in values of 555 units and 888 units. Prove that every amount above 272727 units can be made with these stamps, and that 272727 itself cannot. Show it by giving five amounts in a row that can be made, then adding 555-unit stamps. Then list every amount that cannot be made, and count them. Give the largest amount that cannot be made and the number of such amounts.

Check your answer

Work it out on paper, then type your number. The answer itself stays hidden.

Need a reminder? The key ideaShowHide

ax+by=cax + by = cax+by=c has integer solutions exactly when d=gcd⁡(a,b)∣cd = \gcd(a, b) \mid cd=gcd(a,b)∣c. From one solution (x0,y0)(x_0, y_0)(x0​,y0​), all are

x=x0+bdt,y=y0−adt.\displaystyle x = x_0 + \tfrac{b}{d}t, \qquad y = y_0 - \tfrac{a}{d}t.x=x0​+db​t,y=y0​−da​t.

For coprime a,ba, ba,b the largest nnn that is not ax+byax + byax+by with x,y≥0x, y \ge 0x,y≥0 is ab−a−bab - a - bab−a−b.

The worked solution

Check an answer or open a hint to unlock the worked solution.

Have you tried it?

Work it out on paper first. It is fine to get stuck or make a mistake: that is how we learn. When you are ready, go through the solution one step at a time, and check each step against your own.

Given. Amounts 5x+8y5x + 8y5x+8y with x,y≥0x, y \ge 0x,y≥0.

Step 1. Five in a row. 28=4×5+828 = 4 \times 5 + 828=4×5+8, 29=5+3×829 = 5 + 3 \times 829=5+3×8, 30=6×530 = 6 \times 530=6×5, 31=3×5+2×831 = 3 \times 5 + 2 \times 831=3×5+2×8, 32=4×832 = 4 \times 832=4×8.

Step 2. Every larger amount. Any n≥28n \ge 28n≥28 is one of 28,…,3228, \dots, 3228,…,32 plus some 555-unit stamps. So every amount from 282828 on can be made.

Step 3. 272727 cannot. With y=0,1,2,3y = 0, 1, 2, 3y=0,1,2,3 eights the rest is 27,19,11,327, 19, 11, 327,19,11,3, and none is a multiple of 555. Four eights is 323232, too much.

Step 4. The full list. Testing each amount from 111 to 272727 in the same way leaves 1,2,3,4,6,7,9,11,12,14,17,19,22,271, 2, 3, 4, 6, 7, 9, 11, 12, 14, 17, 19, 22, 271,2,3,4,6,7,9,11,12,14,17,19,22,27: fourteen amounts.

Check. The formulas agree: ab−a−b=40−5−8=27ab - a - b = 40 - 5 - 8 = 27ab−a−b=40−5−8=27 and (a−1)(b−1)2=4×72=14\tfrac{(a - 1)(b - 1)}{2} = \tfrac{4 \times 7}{2} = 142(a−1)(b−1)​=24×7​=14.

Answer: the largest amount that cannot be made is 272727, and 141414 amounts cannot be made. Proof complete.

What if? There is a neat symmetry: for 0≤n≤270 \le n \le 270≤n≤27, exactly one of nnn and 27−n27 - n27−n can be made. That is why exactly half of the 282828 numbers fail.

Log in to save this for later
← All Problems
← A vending machine takes tokens worth 7 units and 11 units and gives no change…A gardener spends exactly 345 units on plants: shrubs at 13 units each and herbs at 8 units each… →
More onNumber Theory

Discussion (0)

Log in to join the discussion.

Loading…

More on this topic

  1. The triangular numbers are 1, 3, 6, 10, …, where the nth one is (n(n + 1))/2…Advanced
  2. Prove that the equation x³ + y³ + z³ = n has no solution in integers when n leaves remainder 4 or 5…Advanced
  3. Find every triple of positive integers a ≤ b ≤ c with 1/a + 1/b + 1/c = 1, and prove that there are…Advanced
  4. Find all pairs of positive integers (x, y) with x² - y² = 945…Hard
  5. A teacher wants a list of every primitive Pythagorean triple whose hypotenuse is less than 100…Advanced
All problems on this topic →