Problem

Source: Lusophon 2019 CPLP P1

Tags: number theory, Digits, divisible



Find a way to write all the digits of $1$ to $9$ in a sequence and without repetition, so that the numbers determined by any two consecutive digits of the sequence are divisible by $7$ or $13$.