Olympiad Maths Prep

Track / Stage 6 / 196 of 400 #1196 of 2000

Problem 1196

National olympiad, first round
Combinatorics Difficulty 6.3 Find the answer

Find the greatest natural number possessing the property that each of its digits except the first and last one is less than the arithmetic mean of the two neighboring digits.

Official solution

To find the greatest natural number such that each of its digits, except the first and last one, is less than the arithmetic mean of the two neighboring digits, we need to follow these steps:

1. Define the digits:
Let the number be represented as d1d2d3dnd_1d_2d_3\ldots d_n, where d1d_1 is the first digit, dnd_n is the last digit, and did_i are the digits in between.

2. Set up the inequality:
For each digit did_i (where 2in12 \leq i \leq n-1), the condition is:
di<di1+di+12 d_i < \frac{d_{i-1} + d_{i+1}}{2}
This can be rewritten as:
2di<di1+di+1 2d_i < d_{i-1} + d_{i+1}

3. Start with the largest possible first digit:
To maximize the number, start with the largest possible first digit, which is 9. Let d1=9d_1 = 9.

4. Determine the subsequent digits:
- For d2d_2, we need d2<9+d32d_2 < \frac{9 + d_3}{2}. To maximize d2d_2, we should choose d3d_3 as large as possible.
- Let d3=8d_3 = 8. Then:
d2<9+82=8.5    d28 d_2 < \frac{9 + 8}{2} = 8.5 \implies d_2 \leq 8
To maximize d2d_2, let d2=8d_2 = 8.

- For d4d_4, we need d4<8+d52d_4 < \frac{8 + d_5}{2}. To maximize d4d_4, we should choose d5d_5 as large as possible.
- Let d5=7d_5 = 7. Then:
d4<8+72=7.5    d47 d_4 < \frac{8 + 7}{2} = 7.5 \implies d_4 \leq 7
To maximize d4d_4, let d4=7d_4 = 7.

- For d6d_6, we need d6<7+d72d_6 < \frac{7 + d_7}{2}. To maximize d6d_6, we should choose d7d_7 as large as possible.
- Let d7=6d_7 = 6. Then:
d6<7+62=6.5    d66 d_6 < \frac{7 + 6}{2} = 6.5 \implies d_6 \leq 6
To maximize d6d_6, let d6=6d_6 = 6.

- Continue this process until the digits start to decrease significantly.

5. Construct the number:
Following the pattern, we get the number 986421986421.

6. Verify the conditions:
- For d2=8d_2 = 8:
8<9+62=7.5(Condition satisfied) 8 < \frac{9 + 6}{2} = 7.5 \quad \text{(Condition satisfied)}
- For d3=6d_3 = 6:
6<8+42=6(Condition satisfied) 6 < \frac{8 + 4}{2} = 6 \quad \text{(Condition satisfied)}
- For d4=4d_4 = 4:
4<6+22=4(Condition satisfied) 4 < \frac{6 + 2}{2} = 4 \quad \text{(Condition satisfied)}
- For d5=2d_5 = 2:
2<4+12=2.5(Condition satisfied) 2 < \frac{4 + 1}{2} = 2.5 \quad \text{(Condition satisfied)}

Thus, the greatest natural number satisfying the given condition is 986421986421.

The final answer is 986421\boxed{986421}

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