%I #8 Jul 13 2020 21:31:32
%S 1,2,3,2,1,4,5,2,1,2,3,4,1,6,7,2,1,2,3,2,1,4,5,4,1,2,3,6,1,8,9,2,1,2,
%T 3,2,1,4,5,2,1,2,3,4,1,6,7,4,1,2,3,2,1,4,5,6,1,2,3,8,1,10,11,2,1,2,3,
%U 2,1,4,5,2,1,2,3,4,1,6,7,2,1,2,3,2,1,4,5,4,1,2,3,6,1,8,9,4,1,2,3,2,1,4,5,2,1
%N Lexicographically earliest infinite sequence such that a(i) = a(j) => A000035(i) = A000035(j) and A007814(1+A000265(i)) = A007814(1+A000265(j)), for all i, j >= 1.
%C Restricted growth sequence transform of the ordered pair [A000035(n), A007814(1+A000265(n))], parity and the number of trailing 1-bits in the odd part of n (i.e., the length of the rightmost run of 1-bits in its binary expansion).
%C For all i, j: A336146(i) = A336146(j) => a(i) = a(j).
%H Antti Karttunen, <a href="/A336126/b336126.txt">Table of n, a(n) for n = 1..65537</a>
%H <a href="/index/Bi#binary">Index entries for sequences related to binary expansion of n</a>
%o (PARI)
%o up_to = 65537;
%o rgs_transform(invec) = { my(om = Map(), outvec = vector(length(invec)), u=1); for(i=1, length(invec), if(mapisdefined(om,invec[i]), my(pp = mapget(om, invec[i])); outvec[i] = outvec[pp] , mapput(om,invec[i],i); outvec[i] = u; u++ )); outvec; };
%o A000265(n) = (n>>valuation(n,2));
%o A007814(n) = valuation(n,2);
%o Aux336126(n) = [(n%2),A007814(1+A000265(n))];
%o v336126 = rgs_transform(vector(up_to, n, Aux336126(n)));
%o A336126(n) = v336126[n];
%Y Cf. A000265, A007814, A336146.
%K nonn
%O 1,2
%A _Antti Karttunen_, Jul 13 2020