2. On the number line, there is a set of positive, three-digit integers $a$, for which the sum of the digits in their notation equals 16. Find the greatest and the smallest distance between two numbers from this set.
2. Solution. Let $x, y, z$ be the hundreds, tens, and units of the number $a$. According to the condition, $x+y+z=16$. The smallest number satisfying these conditions is $a_{\min }=169$, and the largest number is $a_{\max }=970$. The greatest distance is their difference $d_{\max }=a_{\max }-a_{\min }=801$. The smallest distance between numbers from this set is the smallest distance between adjacent numbers. Let some number from this set be of the form $a=N+10 x+y(N \geq 100)$, then the next number from this set is $b=N+10(x+1)+(y-1)$. The difference between them is $b-a=9$, for example, one can choose $a=169$, and $b=178$. Thus, $d_{\max }=801$, and $d_{\min }=9$.