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 #6 Feb 08 2019 21:43:01
%S 1,2,2,3,2,4,2,5,4,6,2,7,2,8,6,9,2,10,2,11,12,13,2,14,6,15,16,17,2,18,
%T 2,19,20,21,8,22,2,23,24,25,2,26,2,27,28,29,2,30,8,31,32,33,2,34,35,
%U 36,37,38,2,39,2,40,41,42,24,43,2,44,45,46,2,47,2,48,49,50,13,51,2,52,53,54,2,55,56,57,58,59,2,60,61,62,63,64,65,66,2,67,68,69,2,70,2
%N Lexicographically earliest sequence such that for all i, j, a(i) = a(j) => f(i) = f(j) where f(n) = [A032742(n),A302042(n)] for all n > 1, with f(1) = 0.
%C For all i, j:
%C A305800(i) = A305800(j) => a(i) = a(j),
%C a(i) = a(j) => A001222(i) = A001222(j),
%C a(i) = a(j) => A253557(i) = A253557(j).
%H Antti Karttunen, <a href="/A323888/b323888.txt">Table of n, a(n) for n = 1..65537</a>
%o (PARI)
%o up_to = 65537;
%o ordinal_transform(invec) = { my(om = Map(), outvec = vector(length(invec)), pt); for(i=1, length(invec), if(mapisdefined(om,invec[i]), pt = mapget(om, invec[i]), pt = 0); outvec[i] = (1+pt); mapput(om,invec[i],(1+pt))); outvec; };
%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 A020639(n) = if(n>1, if(n>n=factor(n, 0)[1, 1], n, factor(n)[1, 1]), 1); \\ From A020639
%o A032742(n) = (n/A020639(n));
%o v078898 = ordinal_transform(vector(up_to,n,A020639(n)));
%o A078898(n) = v078898[n];
%o A302042(n) = if((1==n)||isprime(n),1,my(c = A078898(n), p = prime(-1+primepi(A020639(n))+primepi(A020639(c))), d = A078898(c), k=0); while(d, k++; if((1==k)||(A020639(k)>=p),d -= 1)); (k*p));
%o A323888aux(n) = if(1==n, 0, [A032742(n),A302042(n)]);
%o v323888 = rgs_transform(vector(up_to, n, A323888aux(n)));
%o A323888(n) = v323888[n];
%Y Cf. A032742, A302042.
%Y Cf. also A001222, A253557, A300247, A305800.
%K nonn
%O 1,2
%A _Antti Karttunen_, Feb 08 2019