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. /Take a three-digit number abc whose first and last digits differ by at least 2…
HardMathematicsHigh School (11–12)Number TheoryConceptualNumericalOlympiad

Take a three-digit number abc whose first and last digits differ by at least 2…

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.

Take a three-digit number abc‾\overline{abc}abc whose first and last digits differ by at least 222. Reverse it and subtract the smaller from the larger. Reverse the result and add. A student tries 532532532: 532−235=297532 - 235 = 297532−235=297, and 297+792=1089297 + 792 = 1089297+792=1089.

  1. Prove that the difference is always 99(a−c)99(a - c)99(a−c) when a>ca > ca>c.
  1. Prove that the final sum is always 108910891089.
  1. For two-digit numbers, how many ab‾\overline{ab}ab make ab‾+ba‾\overline{ab} + \overline{ba}ab+ba a perfect square?

Check your answer

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

Need a reminder? The key ideaShowHide

In base bbb the digits are remainders of repeated division by bbb. abc‾=100a+10b+c\overline{abc} = 100a + 10b + cabc=100a+10b+c. Squares leave 0,10, 10,1 on division by 444 and 0,1,4,70, 1, 4, 70,1,4,7 on division by 999. No square lies strictly between m2m^2m2 and (m+1)2(m + 1)^2(m+1)2.

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.

Step 1. Part (a). (100a+10b+c)−(100c+10b+a)=99a−99c=99(a−c)(100a + 10b + c) - (100c + 10b + a) = 99a - 99c = 99(a - c)(100a+10b+c)−(100c+10b+a)=99a−99c=99(a−c).

Step 2. Part (b). Let t=a−ct = a - ct=a−c, from 222 to 999. Then 99t=100(t−1)+90+(10−t)99t = 100(t - 1) + 90 + (10 - t)99t=100(t−1)+90+(10−t), so its digits are t−1t - 1t−1, 999 and 10−t10 - t10−t. Reversed, it is 100(10−t)+90+(t−1)100(10 - t) + 90 + (t - 1)100(10−t)+90+(t−1). The sum is 100×9+180+9=1089100 \times 9 + 180 + 9 = 1089100×9+180+9=1089.

Step 3. Part (c). ab‾+ba‾=11(a+b)\overline{ab} + \overline{ba} = 11(a + b)ab+ba=11(a+b). For a square we need 11∣a+b11 \mid a + b11∣a+b, and a+b≤18a + b \le 18a+b≤18, so a+b=11a + b = 11a+b=11. Then the sum is 121=112121 = 11^2121=112. With a≥1a \ge 1a≥1 and b≥1b \ge 1b≥1 (so that ba‾\overline{ba}ba is also a two-digit number), aaa runs from 222 to 999: 29,38,47,56,65,74,83,9229, 38, 47, 56, 65, 74, 83, 9229,38,47,56,65,74,83,92. That is 888 numbers.

Answer: the sum is always 108910891089; 888 two-digit numbers work. Proof complete.

Log in to save this for later
← All Problems
← Prove that 1/n has an ending decimal exactly when n = 2ⁱ 5ʲ…Prove that none of 11, 111, 1111, … is a perfect square… →
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 →