login
A352391
Lexicographically earliest sequence of distinct positive integers such that the last digit of |a(n) - a(n+1)| is the n-th digit of the sequence.
0
1, 2, 4, 8, 16, 5, 11, 6, 7, 18, 12, 19, 20, 28, 17, 15, 14, 23, 21, 31, 9, 27, 26, 33, 22, 37, 36, 32, 10, 13, 25, 24, 47, 46, 55, 3, 30, 42, 48, 35, 38, 40, 52, 29, 56, 43, 49, 62, 50, 39, 59, 58, 45, 57, 72, 60, 64, 68, 41, 65, 71, 66, 51, 54, 67, 77, 53, 75, 61, 69, 82, 87, 34, 92, 78, 88, 63, 85, 73
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