Daily

Random

Practice set

Baltic Way 2010 · Problem 17

Number Theory

Find all positive integers nn such that the decimal representation of n2n^{2} consists of odd digits only.

Change pool

When you’re ready

Review material becomes available with the next Daily.

Review

Topics

Modular arithmetic

Solutions

Solution

The only such numbers are n=1n = 1 and n=3n = 3. If nn is even, then so is the last digit of n2n^2. If nn is odd and divisible by 55, then n=10k+5n = 10k + 5 for some integer k≥0k \ge 0 and the second-to-last digit of n2=(10k+5)2=100k2+100k+25n^2 = (10k + 5)^2 = 100k^2 + 100k + 25 equals 22. Thus we may restrict ourselves to numbers of the form n=10k±mn = 10k \pm m, where m∈{1,3}m \in \{1, 3\}. Then

n2=(10k±m)2=100k2±20km+m2=20k(5k±m)+m2n^2 = (10k \pm m)^2 = 100k^2 \pm 20km + m^2 = 20k(5k \pm m) + m^2

and since m2∈{1,9}m^2 \in \{1, 9\}, the second-to-last digit of n2n^2 is even unless the number 20k(5k−m)20k(5k - m) is equal to zero. We therefore have n2=m2n^2 = m^2 so n=1n = 1 or n=3n = 3. These numbers indeed satisfy the required condition.

Contest context

Results from Baltic Way 2010

10 teams

Mean score
4.5 / 5
Scores of 4 or 5
9 / 10
Estonia
5 / 5

Score distribution

00
11
20
30
41
58
All team scores
TeamScore
Poland5 / 5
Lithuania5 / 5
Germany5 / 5
Latvia5 / 5
Denmark5 / 5
Sweden5 / 5
Estonia5 / 5
Norway1 / 5
Finland5 / 5
Iceland4 / 5