2024 SSMO Tiebreaker Round Problems/Problem 3

Problem

Let $A=\dots a_2a_1a_0.a_{-1}a_{-2}a_{-3}\dots$ be a terminating decimal. The length of $A$ is defined to be the length of the shortest sub-sequence of consecutive digits that include all nonzero digits and at least one of $a_0,a_{-1}.$ So, the length of $12.03$ is $4$ and the length of $0.123$ is $3.$ Let $f(n)$ be the average of all numbers with a terminating decimal of length $n.$ Find the value of $\left\lfloor\sum_{n=0}^{10}(n+1)f(n)\right\rfloor.$

Solution