Given sequence of 7-digit positive numbers: $a_{1},...,a_{2017}$ with $a_{1}<a_{2}<...<a_{2017}$. Determine $a_{2017}$.

223 Views Asked by At

Given a sequence of 7-digit positive numbers: $a_{1},a_{2},...,a_{2017}$ with $a_{1}<a_{2}<...<a_{2017}$. The digit is ordered such that it is nonincreasing. It is known that $a_{1}=1000000$ and $a_{n+1}$ is the smallest possible number that is greater than $a_{n}$. This means $a_{2}=1100000$ and $a_{3}=1110000$. Determine $a_{2017}$.


Attempt:

Let us define $a_{0}=0000000$ and present the terms for $n=1,2,...,20$, $$ a_{1} = 1000000, a_{2} = 1100000, a_{3} = 1110000, a_{4} = 1111000, a_{5} = 1111100$$ $$ a_{6} = 1111110, a_{7} = 1111111, a_{8} = 2000000, a_{9} = 2100000, a_{10} = 2110000$$ $$ a_{11} = 2111110, a_{12} = 2111111, a_{13} = 2200000, a_{14} = 2210000, a_{15} = 2211000$$ $$ a_{16} = 2211100, a_{17} = 2211110, a_{18} = 2211111, a_{19} = 2220000, a_{20} = 2221000$$

We can analyse that the number of sequence that has $1$ as leading digit is $\binom{7}{1} = \binom{6+1}{1}$. Also the number of sequence that has 2 as leading digit is $\binom{6+2}{2}$. In general, the number of sequence that has $j >= 1$ as leading digit is $\binom{6+j}{j}$.

The number of sequence that has leading digit $1,2,..,m$ is therefore: $$ \alpha_{m} = \sum_{j=1}^{m} \binom{6+j}{j}$$

Which means that $a_{\alpha_{m}}$ is the last sequence that has $m$ as leading digit. We can find the simplified form for each $\alpha_{m}$. We will prove that

$$ \alpha_{m} = \sum_{j=1}^{m} \binom{6+j}{j} = \sum_{j=1}^{m} \binom{6+j}{6} $$ $$ = \binom{7}{6} + \binom{8}{6} + \binom{9}{6} + ... + \binom{6+m}{6} = \binom{7+m}{7} - 1$$

We can see $\binom{7+m}{7}$ as the number of ways to pick 7 numbers from the set $\{1,2,...,7+m\}$. But the list can be grouped as, the choice(s) that has $1$ as minimum number, $2$ as minimum number, and so on. These means that

$$ \binom{7+m}{7} = \binom{7+m-1}{6} + \binom{7+m-2}{6} + ... + \binom{7+m-m}{6} + \binom{7+m-(m+1)}{6} $$ $$ \binom{7+m}{7} = 1 + \sum_{j=1}^{m} \binom{6 + j}{6} $$

Thus $\alpha_{m}= \sum_{j=1}^{m} \binom{6 + j}{6} = \binom{7+m}{7} - 1$.

Let us check what value of $m$ such that $\alpha_{m-1} \le 2017 \le \alpha_{m}$. $m$ is $7$, $$ \alpha_{m-1} = 1715 \le 2017 \le \alpha_{m}=3431 $$

So the leading digit of $a_{2017}$ must be $7$. The first sequence with leading 7 is $a_{1716}$. How about the 2nd digit? The number of 6 digits sequence leading 1,2,..,5 is $\binom{6+5}{6} - 1 = 461$, with leading 1,2,..,4 is $209$. Now because $1715 + 209 < 2017 < 1715 + 461$, then we can conclude that the 2nd digit must be a 5. We can continue doing this until we find that $a_{2017}=75$*****.

Are there better or quicker approaches?

2

There are 2 best solutions below

1
On

I don't think there is a faster way than recursing down the digits, but at each step you could have found / reasoned about your result a bit faster.

Consider any $n$-digit number with leading digit $\in [0, m]$. (I.e. we allow $0000000$ for now.) By the rules given, this number is uniquely specified by the $(m+1)$-tuple $(a_0, a_1, \dots, a_m)$ where $a_j =$ how many times digit $j \in [0,m]$ appears, and $a_j \ge 0$. And we have:

$$a_0 + a_1 + a_2 + \dots + a_m = n$$

This is a standard stars-and-bars problem (Theorem 2 in the wikipedia article with $k=m+1$) and so the number of such numbers ($n$ digits, leading digit $\le m$) is:

$${n + (m+1) - 1 \choose (m+1)-1} = {n + m \choose m} = {n + m \choose n}$$

Now the above allowed $0000000$, but this just means you're looking for the $2018$th number instead of the $2017$th.

  • ${7 + 6 \choose 7} = 1716 < 2018 \le {7 + 7 \choose 7} = 3432 \implies $ leading digit is $7$.

  • $2018 - 1716 = 302$ and now you're looking at $n=6$. So ${10 \choose 6} = 210 < 302 \le {11 \choose 6} = 462 \implies $ next digit is $5$.

  • $302 - 210 = 92$ and now you're looking at $n=5$. So ${8 \choose 5} = 56 < 92 \le {9 \choose 5} = 126 \implies$ next digit is $4$.

  • $92 - 56 = 36, n = 4$... ${7 \choose 4} = 35 < 36 \le {8 \choose 4} = 70 \implies$ next digit is $4$.

  • $36 - 35 = 1$ so we got lucky and the rest of the digits are $0$s.

  • Note: the math guarantees that the digits found by this process are non-increasing; but as a sanity check it's still good to see that they are indeed non-increasing. :)

Hence the answer is $7544000$.

0
On

Hint: I don't think there is an essentially better way than suggested by OP and the nicely elaborated answer by @antkam.

Note the sequence $a_1,\ldots,a_{2017}$ is a subsequence of the Numbers with digits in nonincreasing order stored as A009996 in OEIS.

The formula which is presented there to calculate sequence elements is essentially the same that we can see in the answer by @antkam indicating that no simpler way is known.