MathLabs

Problem 1

For a positive integer mm, denote by S(m)S(m) and P(m)P(m) the sum and product, respectively, of the digits of mm. Show that for each positive integer nn, there exist positive integers a1,a2,…,ana_1,a_2,\ldots,a_n satisfying S(a1)<S(a2)<⋯<S(an)S(a_1)<S(a_2)<\cdots<S(a_n) and S(ai)=P(ai+1)S(a_i)=P(a_{i+1}) for i=1,2,…,ni=1,2,\ldots,n, where an+1=a1a_{n+1}=a_1.
Step 3 of 3: Close the cycle
a1:  2 occurs k+n−1 times,1 occurs 2k−2(k+n−1) timesa_1:\;2\text{ occurs }k+n-1\text{ times},\quad 1\text{ occurs }2^k-2(k+n-1)\text{ times}
Detailed analysis

Choose a1a_1 with the displayed digit counts; this is possible if 2k>2(k+n−1)2^k>2(k+n-1). Then S(a1)=2kS(a_1)=2^k and P(a1)=2k+n−1P(a_1)=2^{k+n-1}. Thus the sums strictly increase, each S(ai)S(a_i) equals the next product, and S(an)=P(a1)S(a_n)=P(a_1), proving all requirements.