The differences between adjacent digits of a number decrease when viewing the decimal representation of the number from left to right.

## Solution

Let \(a_{1} a_{2} \ldots a_{k}\) be the decimal representation of a number, each non-edge digit of which is less than the arithmetic mean of the adjacent digits. Then

\(a_{1}-a_{2}>a_{2}-a_{3}>\ldots>a_{k-1}-a_{k}\). If the first four differences \(a_{1}-a_{2}, a_{2}-a_{3}, a_{3}-a_{4}, a_{4}-a_{5}\) were positive, then the difference

\(a_{1}-a_{5}=\left(a_{1}-a_{2}\right)+\left(a_{2}-a_{3}\right)+\left(a_{3}-a_{4}\right)+\left(a_{4}-a_{5}\right)\) would be at least \(4+3+2+1=10\), which is impossible.

Therefore, only three differences \(a_{1}-a_{2}, a_{2}-a_{3}\),

\(a_{3}-a_{4}\) can be positive. Similarly, only three differences \(a_{k-3}-a_{k-2}, a_{k-2}-a_{k-1}, a_{k-1}-a_{k}\) can be negative. In addition, one more difference between adjacent digits can be zero.

The above means that the number has no more than 8 digits (no more than \(3+3+1=7\) differences between adjacent digits). To make the desired eight-digit number as large as possible, we need to set \(a_{1}=9\) and choose the differences \(a_{i}-a_{i+1}\) to be the smallest possible (with the condition that there are three positive, three negative, and one zero difference): \(a_{1}-a_{2}=3, a_{2}-a_{3}=2, a_{3}-a_{4}=1, a_{4}-a_{5}=0, a_{5}-a_{6}=-1, a_{6}-a_{7}=-2\), \(a_{7}-a_{8}=-3\)

## Answer

96433469.
Find the largest natural number in which each non-edge digit is less than the arithmetic mean of the adjacent digits.

#