TITLE: A way to combine the numbers from 1 to 9 and get a number in which any two consecutive digits e divisible by 7 or 13.
QUESTION [5 upvotes]: Find a way to write the digits from 1 to 9 in sequence, in such way that the numbers determined by any two consecutive digits is divisible by 7 or 13. 
This is let $a_{1}=1,...,a_{9}=9$ find a way to write 
$$a_{i_{1}}a_{i_{2}}\cdots a_{i_{9}}$$ such that $a_{i}a_{i+1}$ is divisible by 7 or 13 for $i=1,...,8$. 
(Here we mean $a_{i_{1}}a_{i_{2}}\cdots a_{i_{9}}=10^{8}a_{1}+10^{7}a_{2}+\cdots+10a_{8}+a_{9}$, as well $a_{i}a_{i+1}=10a_{i}+a_{i+1}$.)
This problem is from OBM (Brazilian Mathematics Olympiad)

REPLY [3 votes]: Multiples of $13$ with two digits are $13, 26, 39, 52, 65, 78, 91$.
Multiples of $7$ with two digits, without $0$ or repeated digits, are $14, 21, 28, 35, 42, 49, 56, 63, 84, 91$. It has to start with $7$, because noone ends with $7$. Hence 
$$
784913526.
$$
Edit, beated in time ..