The set $M$ consists of all $7$-digit positive integer numbers that contain (in decimal notation) each of the digits $1, 3, 4, 6, 7, 8$ and $9$ exactly once. (a) Find the smallest positive difference $d$ of two numbers from $M$. (b) How many pairs $(x, y)$ with $x$ and $y$ from M are there for which $x - y = d$? (Gerhard Kirchner)
Problem
Source: 2020 Austrian Regional Competition For Advanced Students p2
Tags: Digits, number theory