Daily

Random

Practice set

Baltic Way 1995 · Problem 4

Number Theory

John is older than Mary. He notices that if he switches the two digits of his age (an integer), he gets Mary's age. Moreover, the difference between the squares of their ages is the square of an integer. How old are Mary and John?

Change pool

When you’re ready

Review material becomes available with the next Daily.

Review

Topics

Diophantine equations · Divisibility and factorization

Solutions

Solution

Solution:

Let John's age be 10a+b10a + b where 0≤a,b≤90 \leq a, b \leq 9. Then Mary's age is 10b+a10b + a, and hence a>ba > b. Now

(10a+b)2−(10b+a)2=9⋅11(a+b)(a−b).(10a + b)^2 - (10b + a)^2 = 9 \cdot 11 (a + b)(a - b).

Since this is the square of an integer, a+ba + b or a−ba - b must be divisible by 1111. The only possibility is clearly a+b=11a + b = 11. Hence a−ba - b must be a square. A case study yields the only possibility a=6,b=5a = 6, b = 5. Thus John is 6565 and Mary 5656 years old.

Contest context

Results from Baltic Way 1995

9 teams

Mean score
5.0 / 5
Scores of 4 or 5
9 / 9
Estonia
5 / 5

Score distribution

00
10
20
30
40
59
All team scores
TeamScore
Poland5 / 5
Latvia5 / 5
Sweden5 / 5
Lithuania5 / 5
Denmark5 / 5
Finland5 / 5
St. Petersburg5 / 5
Estonia5 / 5
Iceland5 / 5