OFFSET
1,2
COMMENTS
The sequence S starts with a(1) = 1 and a(2) = 3. S is extended by duplicating the first term A among the not yet duplicated terms, under the condition that [A + the last term Z of the sequence] is divisible by 3. If this is not the case, we then extend S with the smallest integer X not yet present in S such that [X + the last term Z of the sequence] is not divisible by 3. This is the lexicographically first 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) = 3.
Can we duplicate a(1) to form a(3)? No, as a(2) + a(3) would be 4 and 4 is not divisible by 3; we thus extend S with the smallest integer X not yet in S such that [X + a(2)] is not divisible by 3. We get X = 2 and thus a(3) = 2.
Can we duplicate a(1) to form a(4)? Yes, as now [a(1) + a(3)] is divisible by 3; we get thus a(4) = 1.
Can we duplicate a(2) to form a(5)? No, as a(4) + a(2) would be 4 and 4 is not divisible by 3; we thus extend S with the smallest integer X not yet in S such that [X + a(4)] is not divisible by 3. We get X = 4 and thus a(5) = 4.
Can we duplicate a(2) to form a(6)? No, as a(5) + a(2) would be 7 and 7 is not divisible by 3; we thus extend S with the smallest integer X not yet in S such that [X + a(5)] is not divisible by 3. We get X = 6 and thus a(6) = 6.
Can we duplicate a(2) to form a(7)? Yes, as now [a(2) + a(6)] is divisible by 3; we get thus a(7) = 3.
Can we duplicate a(3) to form a(8)? No, as a(7) + a(3) would be 5 and 5 is not divisible by 3; we thus extend S with the smallest integer X not yet in S such that [X + a(6)] is not divisible by 3. We get X = 6 and thus a(8) = 5.
Etc.
CROSSREFS
KEYWORD
nonn,base
AUTHOR
Alexandre Wajnberg and Eric Angelini, Mar 11 2019
STATUS
approved