Given \$A = (a_1,\dots,a_k)\ k\ge2 \$ a sequence of positive integers, in which all elements are different.
Starting from \$i=2\$, while \$a_i\in A:\$ (until the last element)
- If \$d=|a_i-a_{i-1}|\$ is not already in \$A\$, append \$d\$ to \$A\$
- Increase \$i\$
Output the completed sequence.
This is code-golf
Example
In: 16 21 11 2
16 21 11 2 5
--^
16 21 11 2 5 10
--^
16 21 11 2 5 10 9
--^
16 21 11 2 5 10 9 3
--^
16 21 11 2 5 10 9 3
--^
16 21 11 2 5 10 9 3 1
--^
16 21 11 2 5 10 9 3 1 6
--^
16 21 11 2 5 10 9 3 1 6
--^
16 21 11 2 5 10 9 3 1 6
--^
Out: 16 21 11 2 5 10 9 3 1 6