OFFSET
1,2
EXAMPLE
|a(1) - a(2)| = |1 - 2| = 1 and the terminal 1 of 1 is the 1st digit of the sequence;
|a(2) - a(3)| = |2 - 4| = 2 and the terminal 2 of 2 is the 2nd digit of the sequence;
|a(3) - a(4)| = |4 - 8| = 4 and the terminal 4 of 4 is the 3rd digit of the sequence;
|a(4) - a(5)| = |8 - 16| = 8 and the terminal 8 of 8 is the 4th digit of the sequence;
|a(5) - a(6)| = |16 - 5| = 11 and the terminal 1 of 11 is the 5th digit of the sequence; etc.
MATHEMATICA
a[1]=1; a[n_]:=a[n]=Block[{k=1}, While[MemberQ[s=Array[a, n-1], k]||Mod[Abs[a[n-1]-k], 10]!=Flatten[IntegerDigits/@s][[n-1]], k++]; k]; Array[a, 79] (* Giorgos Kalogeropoulos, May 09 2022 *)
CROSSREFS
KEYWORD
base,nonn
AUTHOR
Eric Angelini and Carole Dubois, Mar 14 2022
STATUS
approved