Reminder: The OEIS is hiring a new managing editor, and the application deadline is January 26.
%I #18 Mar 15 2019 12:33:57
%S 1,2,2,3,2,4,3,5,2,6,4,7,3,7,5,8,2,9,6,10,4,11,7,12,3,10,7,13,5,12,8,
%T 14,2,15,9,16,6,17,10,18,4,17,11,19,7,20,12,21,3,16,10,22,7,19,13,23,
%U 5,18,12,23,8,21,14,24,2,25,15,26,9,27,16,28,6,29,17,30,10,31,18,32,4,27,17,33,11,34,19,35,7,31,20,36,12,37,21,38,3,26,16,39,10,33,22
%N Lexicographically earliest positive sequence such that a(i) = a(j) => A002487(i) = A002487(j) and A278222(i) = A278222(j), for all i, j >= 0.
%C Restricted growth sequence transform of the ordered pair [A002487(n), A278222(n)].
%H Antti Karttunen, <a href="/A323889/b323889.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) = 2 for all n >= 0.
%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 A002487(n) = { my(a=1, b=0); while(n>0, if(bitand(n, 1), b+=a, a+=b); n>>=1); (b); }; \\ From A002487
%o A005940(n) = { my(p=2, t=1); n--; until(!n\=2, if((n%2), (t*=p), p=nextprime(p+1))); t };
%o A046523(n) = { my(f=vecsort(factor(n)[, 2], , 4), p); prod(i=1, #f, (p=nextprime(p+1))^f[i]); }; \\ From A046523
%o A278222(n) = A046523(A005940(1+n));
%o Aux323889(n) = [A002487(n), A278222(n)];
%o v323889 = rgs_transform(vector(1+up_to,n,Aux323889(n-1)));
%o A323889(n) = v323889[1+n];
%Y Cf. A002487, A278222, A286622, A324400.
%Y Cf. also A103391, A278243, A286378, A318311, A323892, A323897 and A324533 for a "deformed variant".
%K nonn,look
%O 0,2
%A _Antti Karttunen_, Feb 09 2019