Maths Olympiad Prep

Track / Stage 6 / 283 of 400 #1283 of 1964

Problem 1283

National olympiad, first round
Number theory Difficulty 6.5 Find the answer

Given a positive integer nn, let p(n)p(n) be the product of the non-zero digits of nn. (If nn has only one digits, then p(n)p(n) is equal to that digit.) Let S=p(1)+p(2)+p(3)++p(999). S=p(1)+p(2)+p(3)+\cdots+p(999). What is the largest prime factor of SS?

A number or a short expression. Spacing, $ signs and \frac vs / are all fine.

Official solution

1. Understanding the Problem:
We need to find the sum S S of the products of the non-zero digits of all numbers from 1 to 999. For a number n n , p(n) p(n) is defined as the product of its non-zero digits.

2. Breaking Down the Problem:
We can consider the numbers from 1 to 999 as three-digit numbers by padding with leading zeros if necessary. For example, 5 can be considered as 005.

3. **Calculating p(n) p(n) for Each Digit:**
- For a single-digit number n n , p(n)=n p(n) = n .
- For a two-digit number n=10a+b n = 10a + b , p(n)=ab p(n) = a \cdot b if a0 a \neq 0 and b0 b \neq 0 .
- For a three-digit number n=100a+10b+c n = 100a + 10b + c , p(n)=abc p(n) = a \cdot b \cdot c if a,b,c0 a, b, c \neq 0 .

4. **Summing p(n) p(n) for All Numbers from 1 to 999:
We need to consider the contribution of each digit position (hundreds, tens, and units) separately.

5. Contribution of Each Digit Position:**
- Each digit from 1 to 9 appears in each position (hundreds, tens, units) exactly 100 times in the range from 1 to 999.
- The sum of the non-zero digits from 1 to 9 is 1+2+3++9=45 1 + 2 + 3 + \cdots + 9 = 45 .

6. Calculating the Total Sum:
- For each digit position, the sum of the products of the non-zero digits is 45 45 (since each digit from 1 to 9 appears 100 times).
- Therefore, the total sum for each position is 45×100=4500 45 \times 100 = 4500 .

7. Combining the Contributions:
- Since there are three positions (hundreds, tens, units), the total sum S S is 4500+4500+4500=13500 4500 + 4500 + 4500 = 13500 .

8. Correcting the Calculation:
- We need to consider the product of the non-zero digits for each number. For example, for 105, p(105)=1×5=5 p(105) = 1 \times 5 = 5 .
- The correct approach is to consider the product of the sums of the non-zero digits for each position.

9. Revisiting the Calculation:
- The sum of the products of the non-zero digits for each position is (1+1+2+3++9)=46 (1 + 1 + 2 + 3 + \cdots + 9) = 46 .
- Therefore, the total sum S S is 463 46^3 .

10. Final Calculation:
S=463=46×46×46=97336 S = 46^3 = 46 \times 46 \times 46 = 97336

11. Finding the Largest Prime Factor:
- We need to find the prime factors of 97336.
- The prime factorization of 97336 is 23×11567 2^3 \times 11567 .
- The largest prime factor is 11567.

The final answer is 11567\boxed{11567}.

Source: NuminaMath-1.5, licensed Apache-2.0. Statement and solution reproduced as published; topic, difficulty and ordering added by this site.