2025 SSMO Speed Round Problems/Problem 5

Revision as of 16:28, 9 September 2025 by Sedro (talk | contribs) (Solution)

Problem

Let $N = 101112\cdots9899$ be the number formed when all the two-digit positive integers are concatenated in increasing order. How many ordered triples of digits $(a,b,c)$ are there such that $a,$ $b,$ and $c$ appear as consecutive digits (in that order) in the decimal representation of $N$?

Solution

Since there are $90$ two-digit positive integers, $N$ has $180$ digits. Then, there are $180 - 2 = 178$ (not necessarily distinct) ordered triples of digits $(a,b,c)$ such that the string of digits $abc$ appears in the decimal representation of $N$. Furthermore, any such string $abc$ can appear at most twice in $N$. This is because if $abc$ appears in $N$, then either $\overline{ab}$ or $\overline{bc}$ is one of the two-digit positive integers that was originally concatenated to form $N$. Each of these two possibilities fixes the position of the string $abc$ among the digits of $N$ because every two-digit positive integer was used exactly once in forming $N$. Therefore, we will count the number of strings $abc$ that appear twice in $N$ and then subtract that number from $178$.

Suppose the string $abc$ appears twice in $N$. Let $?$ denote any unknown digit. Then, $\overline{ab}$ and $\overline{c?}$ are consecutive two-digit positive integers in that order, and $\overline{?a}$ and $\overline{bc}$ are also consecutive two-digit positive integers in that order. If $\overline{?a}$ and $\overline{bc}$ are consecutive, we must have $a\ne c$. If $\overline{ab}$ and $\overline{c?}$ are consecutive in that order and $a\ne c$, we must have $c = a+1$ and $b=9$. This implies that $(a,b,c) = (d,9,d+1)$, where $d$ is some digit.

Now, the string $abc$ appears twice in $N$ so long as each of $\overline{ab}$, $\overline{c?}$, $\overline{?a}$, and $\overline{bc}$ is indeed a two-digit positive integer. This is equivalent to $a$, $b$, and $c$ all being nonzero digits, which means that we must have $d \in \{1,2,\dots, 8\}$. Each value of $d$ corresponds to a unique string that appears twice in $N$, so the answer is $178-8 = \boxed{170}$.

~Sedro