Problem

Source: Russian 2007

Tags: combinatorics proposed, combinatorics



Pete chose a positive integer $ n$. For each (unordered) pair of its decimal digits, he wrote their difference on the blackboard. After that, he erased some of these differences, and the remaining ones are $ 2,0,0,7$. Find the smallest number $ n$ for which this situation is possible.