Maths Olympiad Prep

Library / /19 of 24

, 2018

Number theory Difficulty 5.7 AIME, harder Prove it United States

Problem:
Let m>1m > 1 be a fixed positive integer. For a nonempty string of base-ten digits SS, let c(S)c(S) be the number of ways to split SS into contiguous nonempty strings of digits such that the base-ten number represented by each string is divisible by mm. These strings are allowed to have leading zeroes.
In terms of mm, what are the possible values that c(S)c(S) can take?
For example, if m=2m = 2, then c(1234)=2c(1234) = 2 as the splits 12341234 and 123412 \mid 34 are valid, while the other six splits are invalid.

Solution

Solution:
Answer: 00 and 2n2^{n} for all nonnegative integer nn

First, we note that c(1)=0c(1) = 0 and c(000)=2n1c(00 \ldots 0) = 2^{n-1} if there are nn zeroes in the string. Now we show that these are the only possibilities. Note that a split can be added if and only if the string before this split (ignoring all other splits) represents a multiple of mm (if there is a split before it, then removing the digits before this preceding split is equivalent to subtracting the removed number times a power of 1010, which will also be a multiple of mm, so the remaining number between the two splits remains a multiple of mm). Thus, whether we can add a split or not depends only on the string itself and no other splits, so c(S)c(S) is 00 if the number is not divisible by mm and a power of two otherwise.

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.