Maths Olympiad Prep

Library / HMMT February /1076 of 1302

HMMT February, 2018

Combinatorics Difficulty 5.7 AIME, harder Prove it United States

Problem:

How many ordered sequences of 36 digits have the property that summing the digits to get a number and taking the last digit of the sum results in a digit which is not in our original sequence? (Digits range from 0 to 9.)

Solution

Solution:

We will solve this problem for 36 replaced by nn. We use [n][n] to denote {1,2,…,n}\{1,2, \ldots, n\} and σs\sigma_{s} to denote the last digit of the sum of the digits of ss.
Let DD be the set of all sequences of nn digits and let SiS_{i} be the set of digit sequences ss such that si=σss_{i}=\sigma_{s}, the ithi^{\text{th}} digit of ss. The quantity we are asked to compute is equal to ∣D\⋃i=1nSi∣\left|D \backslash \bigcup_{i=1}^{n} S_{i}\right|. We use the principle of inclusion-exclusion to compute this:
∣D\⋃i=1nSi∣=∑J⊆[n](−1)∣J∣∣⋂j∈JSj∣ \left|D \backslash \bigcup_{i=1}^{n} S_{i}\right|=\sum_{J \subseteq[n]}(-1)^{|J|}\left|\bigcap_{j \in J} S_{j}\right|
Note that a digit sequence is in SiS_{i} if and only if the n−1n-1 digits which are not ii sum to a multiple of 10. This gives that ∣Si∣=10⋅10n−2=10n−1\left|S_{i}\right|=10 \cdot 10^{n-2}=10^{n-1} as there are 10 ways to pick the ithi^{\text{th}} digit and 10n−210^{n-2} ways to pick the other digits.

Similarly, given a subset J⊆[n]J \subseteq[n], we can perform a similar analysis. If a string ss is in ⋂j∈JSj\bigcap_{j \in J} S_{j}, we must have that sj=σss_{j}=\sigma_{s} for all j∈Jj \in J. There are 10 ways to pick σs\sigma_{s}, which determines sjs_{j} for all j∈Jj \in J. From there, there are 10(n−∣J∣)−110^{(n-|J|)-1} ways to pick the remaining digits as if we fix all but one, the last digit is uniquely determined. This gives 10n−∣J∣10^{n-|J|} choices.

However, this breaks down when ∣J∣=n|J|=n, as not all choices of σs\sigma_{s} lead to any valid solutions. When ∣J∣=n|J|=n, J=[n]J=[n] and we require that the last digit of nσsn \sigma_{s} is σs\sigma_{s}, which happens for gcd⁡(n−1,10)\operatorname{gcd}(n-1,10) values of σs\sigma_{s}.

We now compare our expression from the principle of inclusion-exclusion to the binomial expansion of (10−1)n(10-1)^{n}. By the binomial theorem,
9n=(10−1)n=∑J⊆[n](−1)∣J∣10n−∣J∣ 9^{n}=(10-1)^{n}=\sum_{J \subseteq[n]}(-1)^{|J|} 10^{n-|J|}
These agree on every term except for the term where J=[n]J=[n]. In this case, we need to add an extra (−1)ngcd⁡(n−1,10)(-1)^{n} \operatorname{gcd}(n-1,10) and subtract (−1)n(-1)^{n}.

Thus our final value for ∣D\⋃i=1nSi∣\left|D \backslash \bigcup_{i=1}^{n} S_{i}\right| is 9n+(−1)n(gcd⁡(n−1,10)−1)9^{n}+(-1)^{n}(\operatorname{gcd}(n-1,10)-1), which is 936+49^{36}+4 for n=36n=36.

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

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