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
  • Earth and Environmental Science
  • 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. /A teacher writes some whole numbers on the board…
HardMathematicsHigh School (11–12)Pigeonhole Principle, Recursion and Graph TheoryproofNumericalOlympiad

A teacher writes some whole numbers on the board…

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.

A teacher writes some whole numbers on the board. She claims that whenever there are at least 777 of them, two can always be found whose sum or difference is divisible by 101010.

Prove her claim with the pigeonhole principle. Say clearly what the boxes are and how many there are. Then show that 666 numbers are not always enough, by giving six numbers with no such pair. Finally state the fewest numbers that always contain such a pair.

Check your answer

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

Need a reminder? The key ideaShowHide

If n+1n + 1n+1 objects go into nnn boxes, some box holds at least two. Decide what the objects and the boxes are. A "fewest number" answer needs a proof that it is enough and an example showing that one fewer can fail.

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.

Plan. Sort the numbers by their remainder on division by 101010. Pair up remainders that add to 101010.

Step 1. The boxes. Make the boxes {0}\{0\}{0}, {5}\{5\}{5}, {1,9}\{1, 9\}{1,9}, {2,8}\{2, 8\}{2,8}, {3,7}\{3, 7\}{3,7} and {4,6}\{4, 6\}{4,6}. Every remainder lies in exactly one box, and there are 666 boxes.

Step 2. Two numbers in one box. With 777 numbers and 666 boxes, two numbers aaa and bbb fall in one box. If their remainders are equal, a−ba - ba−b is divisible by 101010. If their remainders are rrr and 10−r10 - r10−r, then a+ba + ba+b is divisible by 101010. The boxes {0}\{0\}{0} and {5}\{5\}{5} hold only equal remainders, so the difference works there.

Step 3. Six numbers can fail. Take 0, 1, 2, 3, 4, 5. Each difference is between 111 and 555, so none is divisible by 101010. Each sum of two different numbers is between 111 and 999, so none is divisible by 101010 either.

Step 4. Conclusion. Seven numbers always work and six may not. The fewest number is 777.

Watch out. The box {5}\{5\}{5} cannot be paired with anything: 5+5=105 + 5 = 105+5=10 needs two numbers with remainder 555, and then their difference works anyway.

Answer: 666 boxes, and the fewest number is 777. Proof complete.

Log in to save this for later
← All Problems
← A cupboard holds 6 pairs of black gloves and 4 pairs of brown gloves, 20 gloves in all…Every point of a grid with 3 rows and 7 columns is painted red or blue… →
More onPigeonhole Principle, Recursion and Graph Theory

Discussion (0)

Log in to join the discussion.

Loading…

Learn it in

  1. The pigeonhole principleThe Pigeonhole Principle

More on this topic

  1. The 15 edges of K₆ are coloured red or blue…Advanced
  2. Three houses each need a path to each of three wells, nine paths in all, drawn on flat ground…Advanced
  3. A connected planar graph with 10 vertices is drawn without crossings, and every face of the…Hard
  4. The complete bipartite graph K_(m,n) joins each of m left vertices to each of n right vertices…
Advanced
  • A river town has five land areas, A, B, C, D and E, joined by ten bridges…Hard
  • All problems on this topic →