DR.WANG Mathematics中文

2013 USAMO · Question 5

Number theory · digits

Problem outline

For arbitrary positive integers mm and nn, prove that a single positive multiplier cc can make the decimal expansions of cmcm and cncn have the same nonzero digits, counted with multiplicity.

Show answer and methods 1 methods

Answer

Such a cc always exists. The two decimal strings can even be made cyclic rotations after padding with leading zeros.

Method 1 Construct a rotation modulus

Write n=hsn=hs where hh contains exactly the powers of 22 and 55 in nn, so gcd⁡(s,10)=1\gcd(s,10)=1. Choose ee large enough that 10e/h10^e/h is an integer multiple of 1010 and D=(10em−n)/h>max⁡(m,n)D=(10^e m-n)/h>\max(m,n). This is possible because hh has no prime factor other than 22 or 55. Since D=(10e/h)m−s≡−s(mod10)D=(10^e/h)m-s\equiv-s\pmod{10}, we have gcd⁡(D,10)=1\gcd(D,10)=1. By construction 10em≡n(modD)10^em\equiv n\pmod D.

As 1010 is invertible modulo DD, some positive power 10k10^k is 11 modulo DD (two powers repeat among finitely many residues, and we may cancel the smaller power). Put M=10k−1M=10^k-1 and c=M/Dc=M/D. These are positive integers. Because m,n<Dm,n<D, both cmcm and cncn lie strictly between 00 and MM. Multiplying the preceding congruence by cc yields 10e(cm)≡cn(modM)10^e(cm)\equiv cn\pmod M.

Write a number uu with 0<u<M0<u<M using exactly kk decimal places, padding on the left with zeros. If its leading digit is dd and its remaining block represents rr, then u=d10k−1+ru=d10^{k-1}+r and 10u≡10r+d(modM)10u\equiv10r+d\pmod M. This moves the leading digit to the right end. The rotated word is neither all zeros nor all nines, so its value is the unique residue in (0,M)(0,M).

Apply this rotation ee times to the padded string for cmcm. Its value is congruent to cncn and lies in the same interval, hence equals cncn. Rotation preserves the number of occurrences of every digit. Removing any leading zeros afterwards leaves precisely equal multiplicities of every nonzero digit, as claimed.

Source and attribution

The outline and worked methods on this page were prepared for DR.WANG Mathematics.

Original question (external)