OFFSET
1,2
COMMENTS
The sequence S starts with a(1) = 1 and a(2) = 2. S is extended by duplicating the first term A among the not yet duplicated terms of S, under the condition that the sum [a(n-1) + a(n)] is divisible by the leftmost digit of a(n). If this is not the case, we then extend S with the smallest integer X not yet present in S such that the sum [a(n-1) + a(n)] is not divisible by the leftmost digit of a(n). This is the lexicographically earliest sequence with this property.
LINKS
Jean-Marc Falcoz, Table of n, a(n) for n = 1..10002
EXAMPLE
S starts with a(1) = 1 and a(2) = 2
Can we duplicate a(1) to form a(3)? Yes, as the sum [a(2) + a(3) = 3] is divisible by 1, the leftmost digit of a(3); thus a(3) = 1.
Can we duplicate a(2) to form a(4)? No, as the sum [a(3) + a(4) = 3] is not divisible by 2, the leftmost digit of a(4); we thus extend S with the smallest integer X not yet in S such that the sum [a(3) + X] is not divisible by the leftmost digit of a(4); thus a(4) = 3.
Can we duplicate a(2) to form a(5)? No, as the sum [a(4) + a(5) = 7] is not divisible by 2, the leftmost digit of a(5); we thus extend S with the smallest integer X not yet in S such that the sum [a(4) + X] is not divisible by the leftmost digit of a(5); thus a(5) = 4.
Can we duplicate a(2) to form a(6)? Yes, as the sum [a(5) + a(6) = 6 is divisible by 2, the leftmost digit of a(6); thus a(6) = 2.
Can we duplicate a(3) to form a(7)? Yes, as 1 can always be duplicated; thus a(7) = 1.
Can we duplicate a(4) to form a(8)? No, as the sum [a(7) + a(8) = 5] is not divisible by 2, the leftmost digit of a(8); we thus extend S with the smallest integer X not yet in S such that the sum [a(7) + X] is not divisible by the leftmost digit of a(8); thus a(8) = 5.
Can we duplicate a(4) to form a(9)? No, as the sum [a(8) + a(9) = 8] is not divisible by 3, the leftmost digit of a(9); we thus extend S with the smallest integer X not yet in S such that the sum [a(8) + X] is not divisible by the leftmost digit of a(9); thus a(9) = 6.
Can we duplicate a(4) to form a(10)? Yes, as the sum [a(9) + a(10) = 9] is divisible by 3, the leftmost digit of a(10); thus a(10) = 3.
Etc.
CROSSREFS
KEYWORD
base,nonn
AUTHOR
Eric Angelini and Jean-Marc Falcoz, Mar 11 2019
STATUS
approved