Question 19

For $$n\in\mathbb{N}$$, let $$P(n)$$ denote the product of the digits in $$n$$ and $$S(n)$$ denote the sum of the digits in $$n$$. Consider the set $$A=\{n\in\mathbb{N}:P(n)\text{ is non-zero, square free and }S(n)\text{ is a proper divisor of }P(n)\}$$. Find the maximum possible number of digits of the numbers in $$A$$.


Correct Answer: 92

Let $$n$$ have $$d$$ digits. Write its decimal digits in some order as

$$\underbrace{1,1,\dots,1}_{k\text{ times}},\;a_1,a_2,\dots ,a_r\qquad(k\ge 0,\;r\ge 1).$$

The $$k$$ digits 1 only affect the digit-sum, whereas the $$r$$ digits $$a_1,\dots ,a_r\in\{2,3,4,5,6,7,8,9\}$$ determine the non-zero product.

Step 1: Digits permitted by “square free product”.
A square-free integer has no repeated prime factor. Factorising each possible digit gives

$$\begin{aligned} 2&=2, & 3&=3, & 4&=2^2, & 5&=5,\\ 6&=2\cdot3, & 7&=7, & 8&=2^3, & 9&=3^2. \end{aligned}$$

• 4, 8, 9 each contain a squared prime power ⇒ they are forbidden.
• 0 would make the product zero ⇒ forbidden.
Thus every allowed digit is chosen from $$\{1,2,3,5,6,7\}$$.

Step 2: Preventing repeated prime factors.
Write the overall product as $$P(n).$$ Each prime appearing in $$P(n)$$ must occur once only.

• If the digit 6 ( =2·3 ) is used, neither 2 nor 3 can appear elsewhere.
• Apart from that restriction we may choose at most one digit whose prime content is 2, at most one whose prime content is 3, and at most one 5 or 7.

Step 3: Choose the product as large as possible.
Adding many 1’s increases the digit-sum $$S(n)$$ by 1 each time but does not change $$P(n).$$ Because $$S(n)$$ must be a proper divisor of $$P(n),$$ we want $$P(n)$$ as large as possible so that many 1’s can be inserted without making the sum exceed the product.

The largest square-free product obtainable from single digits is obtained by taking the four mutually coprime digits 2, 3, 5, 7:

$$P(n)=2\cdot3\cdot5\cdot7=210.$$

Step 4: Express the digit-sum.
With these four digits fixed, let $$k$$ be the number of 1’s. Then

$$S(n)=2+3+5+7+k=17+k.$$

Step 5: Make $$S(n)$$ a proper divisor of 210.
The positive divisors of 210 are $$1,2,3,5,6,7,10,14,15,21,30,35,42,70,105,210.$$ The proper divisors that are >17 are

$$21,30,35,42,70,105.$$

Setting $$17+k$$ equal to each of these gives

$$\begin{aligned} 17+k=21 &\Rightarrow k=4,\\ 17+k=30 &\Rightarrow k=13,\\ 17+k=35 &\Rightarrow k=18,\\ 17+k=42 &\Rightarrow k=25,\\ 17+k=70 &\Rightarrow k=53,\\ 17+k=105&\Rightarrow k=88.\\ \end{aligned}$$

All these choices satisfy $$S(n)\lt P(n),$$ but the last one clearly gives the largest number of 1’s.

Step 6: Count the digits.
Taking $$k=88$$ gives $$S(n)=17+88=105,\qquad S(n)\,|\,P(n)\ (210/105=2).$$ Total number of digits

$$d=r+k=4+88=92.$$

Step 7: Why no longer number is possible.
Any other choice of digits yields a product that is either
• smaller than 210 (if one or more of 2, 3, 5, 7 is omitted), or
• repeats a prime factor (if the digit 6 is mixed with 2 or 3).
A smaller product places the upper bound $$S(n)\le P(n)-1$$ lower and therefore allows strictly fewer 1’s than the 88 obtained above.

Hence the maximum possible number of digits of a number in the set $$A$$ is

$$\boxed{92}.$$

Get AI Help

Book Free CAT Mentorship

Get personalized CAT strategy from a 99%iler

500+ students mentored
CAT mentor
banner

banner

50,000+ JEE Students Trusted Our Score Calculator

Predict your JEE Main percentile, rank & performance in seconds

Ask AI