%I #16 Mar 24 2017 21:40:36
%S 1,2,3,1,4,2,5,3,6,7,4,8,9,5,10,11,6,12,7,13,14,8,15,9,16,17,10,18,11,
%T 19,20,12,21,22,13,23,14,24,25,15,26,27,16,28,17,29,30,18,31,32,19,33,
%U 20,34,35,21,36,22,37,38,23,39,40,24,41,25
%N a(n) = a(m) if a(m) has already occurred exactly once and n = a(m) + m + 2, else a(n) = least positive integer that has not yet occurred.
%C From _Bob Selcoe_, Mar 21 2017: (Start)
%C The sequence is composed of two unevenly interleaved subsequences B = {1..i} and C = {1..j}:
%C n: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20
%C B: 1 2 3 - 4 - 5 - 6 7 - 8 9 - 10 11 - 12 - 13
%C C: - - - 1 - 2 - 3 - - 4 - - 5 - - 6 - 7 -
%C 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.
%C 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)
%H Michael De Vlieger, <a href="/A026276/b026276.txt">Table of n, a(n) for n = 1..10000</a>
%t 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 *)
%Y Cf. A009947.
%K nonn
%O 1,2
%A _Clark Kimberling_