OFFSET
1,2
COMMENTS
From Bob Selcoe, Mar 21 2017: (Start)
The sequence is composed of two unevenly interleaved subsequences B = {1..i} and C = {1..j}:
n: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20
B: 1 2 3 - 4 - 5 - 6 7 - 8 9 - 10 11 - 12 - 13
C: - - - 1 - 2 - 3 - - 4 - - 5 - - 6 - 7 -
Terms in C can be derived from B: b(n) = n when n <= 3; when n > 3 and b(n) is not null, then b(n) = c(n+b(n)+2). So for example, c(17) = 6 because b(9) = 6 and 9+6+2 = 17.
b(n) = c(5n/3) as n -> inf.; that is, when a(n) = j first appears, the second appearance approaches a(5n/3) as n -> inf. (End)
LINKS
Michael De Vlieger, Table of n, a(n) for n = 1..10000
MATHEMATICA
a = {1}; Do[AppendTo[a, If[n == # + Position[a, #][[1, 1]] + 2, #, If[Length@ # == 0, Max@ a + 1, First@ #] &@ Complement[Range@ Max@ a, a]]] &@ Last@ SelectFirst[Transpose@ {Values@ #, Keys@ #}, Length@ First@ # == 1 &] &@ PositionIndex[a], {n, 2, 66}]; a (* Michael De Vlieger, Mar 22 2017, Version 10 *)
CROSSREFS
KEYWORD
nonn
AUTHOR
STATUS
approved