Maths Olympiad Prep

Library / /1147 of 1394

, 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)JjJSj \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 n1n-1 digits which are not ii sum to a multiple of 10. This gives that Si=1010n2=10n1\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 10n210^{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 jJSj\bigcap_{j \in J} S_{j}, we must have that sj=σss_{j}=\sigma_{s} for all jJj \in J. There are 10 ways to pick σs\sigma_{s}, which determines sjs_{j} for all jJj \in J. From there, there are 10(nJ)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 10nJ10^{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(n1,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 (101)n(10-1)^{n}. By the binomial theorem,
9n=(101)n=J[n](1)J10nJ 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(n1,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(n1,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,000 problems in a working order, from AMC 10 level to the IMO shortlist.

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