Maths Olympiad Prep

Library / /37 of 48

, 1998

Combinatorics Difficulty 6.5 National Olympiad Prove it Baltic Way

Problem:

We say that an integer mm covers the number 1998 if 1,9,9,81,9,9,8 appear in this order as digits of mm. (For instance, 1998 is covered by 215993698 but not by 213326798.) Let k(n)k(n) be the number of positive integers that cover 1998 and have exactly nn digits (n5n \geqslant 5), all different from 0. What is the remainder of k(n)k(n) in division by 8?

Solution

Solution:

Let 1g<h<i<jn1 \leqslant g < h < i < j \leqslant n be fixed integers. Consider all nn-digit numbers a=a1a2ana = \overline{a_{1} a_{2} \ldots a_{n}} with all digits non-zero, such that ag=1a_{g} = 1, ah=9a_{h} = 9, ai=9a_{i} = 9, aj=8a_{j} = 8 and this quadruple 1998 is the leftmost one in aa; that is,
{al1if l<g;al9if g<l<h;al9if h<l<i;al8if i<l<j \begin{cases} a_{l} \neq 1 & \text{if } l < g ; \\ a_{l} \neq 9 & \text{if } g < l < h ; \\ a_{l} \neq 9 & \text{if } h < l < i ; \\ a_{l} \neq 8 & \text{if } i < l < j \end{cases}
There are kghij(n)=8g18hg18ih18ji19njk_{g h i j}(n) = 8^{g-1} \cdot 8^{h-g-1} \cdot 8^{i-h-1} \cdot 8^{j-i-1} \cdot 9^{n-j} such numbers aa. Obviously, kghij(n)1(mod8)k_{g h i j}(n) \equiv 1 \pmod{8} for g=1,h=2,i=3,j=4g = 1, h = 2, i = 3, j = 4, and kghij(n)0(mod8)k_{g h i j}(n) \equiv 0 \pmod{8} in all other cases. Since k(n)k(n) is obtained by summing up the values of kghij(n)k_{g h i j}(n) over all possible choices of g,h,i,jg, h, i, j, the remainder we are looking for is 11.

Want a route through all this instead of an archive? The track puts 2,000 problems in a working order, from AMC 10 level to the IMO shortlist.

Source: MathNet, licensed CC-BY-4.0. Statement reproduced verbatim; metadata (topic, difficulty) added by this project.