Year-end appeal: Please make a donation to the OEIS Foundation to support ongoing development and maintenance of the OEIS. We are now in our 61st year, we have over 378,000 sequences, and we’ve reached 11,000 citations (which often say “discovered thanks to the OEIS”).
%I #12 Sep 07 2023 23:35:00
%S 1,1,2,1,3,2,4,1,5,3,6,2,5,4,7,1,8,5,9,3,10,6,3,2,11,5,12,4,13,7,4,1,
%T 14,8,15,5,16,9,12,3,9,10,8,6,17,3,6,2,10,11,18,5,11,12,17,4,17,13,11,
%U 7,5,4,19,1,20,14,21,8,22,15,8,5,23,16,24,9,8,12,9,3,16,9,9,10,24,8,24,6,25,17,9,3,10,6,25
%N Lexicographically earliest infinite sequence such that a(i) = a(j) => A331410(i) = A331410(j) and A365385(i) = A365385(j) for all i, j >= 1.
%C Restricted growth sequence transform of the ordered pair [A331410(n), A365385(n)].
%C For all i, j: A365388(i) = A365388(j) => a(i) = a(j) => A365387(i) = A365387(j).
%H Antti Karttunen, <a href="/A365386/b365386.txt">Table of n, a(n) for n = 1..65537</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 A163511(n) = if(!n, 1, my(p=2, t=1); while(n>1, if(!(n%2), (t*=p), p=nextprime(1+p)); n >>= 1); (t*p));
%o A331410(n) = if(!bitand(n,n-1),0,1+A331410(n+(n/vecmax(factor(n)[, 1]))));
%o A365385(n) = A331410(A163511(n));
%o A365386aux(n) = [A331410(n),A365385(n)];
%o v365386 = rgs_transform(vector(up_to,n,A365386aux(n)));
%o A365386(n) = v365386[n];
%Y Cf. A003602, A163511, A331410, A365385, A365387, A365388.
%Y Cf. also A334867.
%K nonn,look
%O 1,3
%A _Antti Karttunen_, Sep 03 2023