The natural numbers are written in sequence, in increasing order, and by this we get an infinite sequence of digits. Find the least natural $k$, for which among the first $k$ digits of this sequence, any two nonzero digits have been written a different number of times. Aleksandar Ivanov, Emil Kolev
Problem
Source: Bulgarian National Round 2006, Problem 3
Tags: search, induction, combinatorics unsolved, combinatorics
10.06.2006 15:54
imortal wrote: ...any two nonzero digits have been written different times. What does this mean?
10.06.2006 17:38
Sorry, I now edited to make it more clear. I meant different number of times. If you have the first k digits of 123456789101112131415161718192021........$d_k$ there are $a_1$ digits 1, $a_2$ digits 2, ..., $a_9$ digits 9, this means that $a_i\neq a_j$ for $i\neq j$
10.06.2006 20:52
imortal wrote: Sorry, I now edited to make it more clear. I meant different number of times. If you have the first k digits of 123456789101112131415161718192021........$d_k$ there are $a_1$ digits 1, $a_2$ digits 2, ..., $a_9$ digits 9, this means that $a_i\neq a_j$ for $i\neq j$ So a trivial upper bound is 2345678 For a number that is all nines, all things have obvious equality. If we put a 1 before it there are more 1's, a 2, there are more 1's and 2's, etc. I dunno, right after having written 2345678 seems to me like the first time but I don't have proof.
24.06.2006 21:18
assume that we have written al the numbers up to $m=\overline{b_nb_{n-1}\ldots b_0}$ in base $10$. We may assume that all the numbers have $n+1$ digits by placing enough zeroes at the beginning since they don't affect the conditions. Now let's compute how many times $a$ appears as $k$'th digit in a number(denote this number by $f_k(a)$). If $a<b_k$ then any number $\overline{c_1c_2\ldots c_{k-1}ax_1x_2\ldots}$ satisfying $\overline{c_1c_2\ldots c_{k-1}}\leq \overline{b_1b_2\ldots b_k}$ is good, so $f_k(a)=10^{n-k}( \overline{b_1b_2\ldots b_k}+1)$. If $a=b_k$ then we must either have $\overline{c_1c_2\ldots c_{k-1}}< \overline{b_1b_2\ldots b_k}$ or $\overline{c_1c_2\ldots c_{k-1}}=\overline{b_1b_2\ldots b_k}$ and $\overline{x_1\ldots} \leq \overline{b_{k+1} \ldots}$ so we deduce $10^{n-k}\overline{b_1b_2\ldots b_{k-1}}+\overline{b_{k+1} \ldots b_0}$. Finally if $a>b_k$ the condition is $\overline{c_1c_2\ldots c_{k-1}}< \overline{b_1b_2\ldots b_k}$ so $f_k(a)=10^{n-k} \overline{b_1b_2 \ldots b_{k-1}}$. So we deduce that $f_k(a)$ depends only on the ordinal relation between $k$ and $a$. If the occurences of any two distinct digits $a,b$ are distinct then for some $k$ we must have $f_k(a) \neq f_k(b)$ which by the ordinal dependence noticed implies $b_k$ is between $a$ and $b$ (including $a,b$). Now taking $b=a+1$ we see that from any two consecutive digits, one is a digit of $m$. So now it's clear that the smallest possible number is $2468$ and if we compute $f_k(a)$ we can see that it indeed is good.
26.06.2006 10:36
well, actually 2468 is incorect answer by two reasons: 1)(trivial) you need the number of digits in the sequence, not the natural number n that you reach, consider also that you may have only part of some number. 2)(non-trivial) in the sequence of digits 123456...(2467)(2468) you have equal number of 7's and 8's. Hint: The answer of the problem (as it should be if you search for the natural n)is bigger than 2468 about 5 times.
26.06.2006 19:39
hmm, yes i realized my mistake. By a similar reasoning we deduce that one of $k,k+1$ is a digit of $n$, where $n$ is the last number whose digits are not used (maybe not all). Suppose the last digit of $n$ is $l$. Then if $l$ is used, it can not make the difference between the number of digits $l$ and the number of digits $l-1$, so one of the digits $l-1,l$ is used one more time. If $l$ is not used, again. Now we deduce that $n$ has at least $5$ digits, and the smallest example is $13578$. Is it correct now?
27.06.2006 17:46
Yes, Iura, now it is correct. The sequence is 123456........1357713578 and the number of its digits is 56784.
08.12.2006 08:09
I did it and my result is also 13578. n-digit numbers can make at most 2n kinds of number of different digit.(use induction to prove it,and it is easy)