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. /A locker code a is a whole number that leaves remainder 5 when it is divided by 9…
HardMathematicsHigh School (11–12)Number TheoryNumericalOlympiad

A locker code a is a whole number that leaves remainder 5 when it is divided by 9…

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 locker code aaa is a whole number that leaves remainder 555 when it is divided by 999. A second code bbb leaves remainder 777 when it is divided by 999. Nobody tells you the codes themselves.

  1. Find the remainder of a2+3aa^2 + 3aa2+3a on division by 999.
  1. Find the remainder of −a-a−a on division by 999. Remember that a remainder is never negative.
  1. Find the remainder of ababab on division by 999.

Explain why the answers do not depend on which codes aaa and bbb were chosen.

Check your answer

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

Need a reminder? The key ideaShowHide

Division algorithm: a=bq+ra = bq + ra=bq+r with 0≤r<b0 \le r < b0≤r<b, and qqq, rrr are unique. If d∣ad \mid ad∣a and d∣bd \mid bd∣b, then d∣ax+byd \mid ax + byd∣ax+by. To prove a fact for every integer, split into cases by the remainder.

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. a=9s+5a = 9s + 5a=9s+5 and b=9t+7b = 9t + 7b=9t+7 for integers sss and ttt.

Plan. Expand each expression. Every term with a factor 999 is a multiple of 999 and does not change the remainder.

Step 1. Part (a). a2+3a=81s2+90s+25+27s+15=9(9s2+13s)+40a^2 + 3a = 81s^2 + 90s + 25 + 27s + 15 = 9(9s^2 + 13s) + 40a2+3a=81s2+90s+25+27s+15=9(9s2+13s)+40. Now 40=9×4+440 = 9 \times 4 + 440=9×4+4, so the remainder is 444.

Step 2. Part (b). −a=−9s−5=9(−s−1)+4-a = -9s - 5 = 9(-s - 1) + 4−a=−9s−5=9(−s−1)+4. The remainder is 444, since 0≤4<90 \le 4 < 90≤4<9.

Step 3. Part (c). ab=81st+63s+45t+35=9(9st+7s+5t)+35ab = 81st + 63s + 45t + 35 = 9(9st + 7s + 5t) + 35ab=81st+63s+45t+35=9(9st+7s+5t)+35. Now 35=9×3+835 = 9 \times 3 + 835=9×3+8, so the remainder is 888.

Why the codes do not matter. Only the remainders 555 and 777 survive in the last term. Everything else is a multiple of 999.

Check. Take a=5a = 5a=5 and b=7b = 7b=7: a2+3a=40a^2 + 3a = 40a2+3a=40 leaves 444, and ab=35ab = 35ab=35 leaves 888.

Answer: the remainders are 444, 444 and 888.

Watch out. The remainder of −a-a−a is not −5-5−5. Add 999 to bring it into the range 000 to 888.

Log in to save this for later
← All Problems
← A student notices that 2⁵ - 2 = 30, 3⁵ - 3 = 240 and 4⁵ - 4 = 1020 are all multiples of 30…Multiply four consecutive whole numbers and add 1… →
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 →