Reminder: The OEIS is hiring a new managing editor, and the application deadline is January 26.
%I #13 Feb 15 2020 08:04:29
%S 1,1,1,2,1,3,2,4,1,5,3,6,2,3,4,4,1,7,5,8,3,9,6,10,2,11,3,10,4,5,4,12,
%T 1,13,7,14,5,15,8,16,3,17,9,18,6,19,10,20,2,17,11,18,3,9,10,21,4,22,5,
%U 8,4,22,12,12,1,23,13,24,7,25,14,26,5,27,15,28,8,19,16,29,3,30,17,31,9,32,18,33,6,34,19,33,10,35,20,36,2,35,17,37,11,38,18,14,3,34
%N Lexicographically earliest infinite sequence such that a(i) = a(j) => A323901(i) = A323901(j) for all i, j.
%C Restricted growth sequence transform of function A323901(n) = A002487(A163511(n)).
%H Antti Karttunen, <a href="/A331742/b331742.txt">Table of n, a(n) for n = 0..65537</a>
%H <a href="/index/Bi#binary">Index entries for sequences related to binary expansion of n</a>
%H <a href="/index/St#Stern">Index entries for sequences related to Stern's sequences</a>
%F a(2^n) = 1 for all n >= 0.
%o (PARI)
%o \\ Needs also code from A323901.
%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 v331742 = rgs_transform(vector(1+up_to, n, A323901(n-1)));
%o A331742(n) = v331742[1+n];
%Y Cf. A002487, A163511, A323901.
%Y Cf. also A286378, A305899, A331743, A331744, A331745.
%K nonn,look
%O 0,4
%A _Antti Karttunen_, Feb 05 2020