Daily

Random

Practice set

Baltic Way 2011 · Shortlist problem

Number Theory

A number NN, written in decimal notation, consists of 20112011 digits. All the digits are 11, except the middle digit. If NN is divisible by 1313, find the middle digit.

Change pool

When you’re ready

Review material becomes available with the next Daily.

Review

Topics

Divisibility and factorization

Solutions

Solution

Since 10011001 is divisible by 1313, so is 111×1001=111111111 \times 1001 = 111111. Noting that 2011=6×334+72011 = 6 \times 334 + 7, by taking off blocks of 111111111111 from NN we deduce that 111X111111X111 is divisible by 1313.

Now reduce the number further by subtracting multiples of 10011001, obtaining multiples of 1313 at every step: 111X111→11(X−1)111→1(X−1)011→(X−1)001→(X−2)00 is divisible by 13. So X=2.111X111 \rightarrow 11(X-1)111 \rightarrow 1(X-1)011 \rightarrow (X-1)001 \rightarrow (X-2)00 \text{ is divisible by } 13. \text{ So } X=2.