Skip to main content
OlympiadHQ

Browse · MathNet

Print

International Mathematical Olympiad

number theory

Problem

For each and , define to be the total number of times the digit appears when all the multiples of between and inclusive are written out in base . Show that there are infinitely many such that there are precisely two distinct values among .
Solution
Let . First, we choose some such that . For instance, any multiple of would work since is coprime to . We will show that either or has the desired property, which completes the proof since can be taken to be arbitrarily large.

For this it suffices to show that . Indeed, if then, since which consists of all nines is a multiple of , we have This means that .

To prove that we need an observation. Let be the decimal expansion of an arbitrary number, possibly with leading zeroes. Then is divisible by if and only if is divisible by . Indeed, this follows from the fact that is divisible by .

This observation shows that the set of multiples of between and is invariant under simultaneous cyclic permutation of digits when numbers are written with leading zeroes. Hence, for each the number is times larger than the number of digit numbers which start from the digit and are divisible by . Since the latter number is either or , we conclude that .

Techniques

Fermat / Euler / Wilson theoremsEnumeration with symmetry