%I #15 Oct 23 2023 20:28:02
%S 1,1,2,1,3,2,2,1,4,3,5,2,3,2,6,1,7,4,2,3,8,5,9,2,10,3,11,2,5,6,12,1,
%T 13,7,6,4,3,2,6,3,14,8,7,5,15,9,16,2,4,10,17,3,2,11,18,2,8,5,19,6,9,
%U 12,20,1,21,13,22,7,21,6,5,4,23,3,24,2,13,6,12,3,25,14,26,8,27,7,13,5,3,15,6,9,28,16,6,2,29,4
%N Lexicographically earliest infinite sequence such that a(i) = a(j) => A366789(i) = A366789(j) and A336158(i) = A336158(j), for all i, j >= 1.
%C Restricted growth sequence transform of the ordered pair [A366789(n), A336158(n)].
%C For all i, j:
%C A003602(i) = A003602(j) => a(i) = a(j) => A366388(i) = A366388(j).
%H Antti Karttunen, <a href="/A366790/b366790.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 A000265(n) = (n>>valuation(n,2));
%o A366789(n) = { my(f=factor(n)); prod(k=1, #f~, A000265(primepi(f[k, 1]))^f[k, 2]); };
%o A046523(n) = { my(f=vecsort(factor(n)[, 2], , 4), p); prod(i=1, #f, (p=nextprime(p+1))^f[i]); }; \\ From A046523
%o A336158(n) = A046523(A000265(n));
%o Aux366790(n) = [A366789(n), A336158(n)];
%o v366790 = rgs_transform(vector(up_to, n, Aux366790(n)));
%o A366790(n) = v366790[n];
%Y Cf. A003602, A336158, A366388, A366789, A366792.
%Y Cf. also A336390, A336470.
%K nonn
%O 1,3
%A _Antti Karttunen_, Oct 23 2023