OFFSET
1,1
COMMENTS
Imagine we would have a pair of adjacent integers in the sequence like [1951, 2020]. The sandwich would then be made of the rightmost digit of a(n), the leftmost digit of a(n+1) and, in between, the absolute difference of those two digits. The pair [1951, 2020] would then produce the (poor) sandwich 112. (Why poor? Because a rich sandwich would insert the sum of the digits instead of their absolute difference - that is 132 in this example). Please note that the pair [2020, 1951] would produce the poor and genuine sandwich 011 (we keep the leading zero: these are sandwiches after all, not integers).
Now we want the sequence to be the lexicographically earliest sequence of distinct positive terms such that the successive sandwiches emerging from the sequence rebuild it, digit after digit.
LINKS
Carole Dubois, Table of n, a(n) for n = 1..125
EXAMPLE
The first successive sandwiches are: 211, 101, 011, 011, 101, 033,...
The first one (211) is visible between a(1) = 2 and a(2) = 1; we get the sandwich by inserting the difference 1 between 2 and 1.
The second sandwich (101) is visible between a(2) = 1 and a(3) = 110; we get this sandwich by inserting the difference 0 between 1 and 1.
The third sandwich (011) is visible between a(3) = 110 and a(4) = 10; we get this sandwich by inserting the difference 1 between 0 and 1; etc.
The successive sandwiches rebuild, digit by digit, the starting sequence.
CROSSREFS
KEYWORD
base,nonn
AUTHOR
Eric Angelini and Carole Dubois, Jun 15 2020
STATUS
approved