%I #6 May 27 2024 19:11:21
%S 1,2,2,3,2,4,2,5,6,7,2,8,2,9,10,11,2,12,2,13,14,15,2,16,17,18,19,20,2,
%T 21,2,22,23,24,25,26,2,27,28,29,2,30,2,31,32,33,2,34,35,36,37,38,2,39,
%U 28,40,41,42,2,43,2,44,45,46,47,48,2,49,50,51,2,52,2,53,54,55,56,57,2,58,59,60,2,61,62,63,64,65,2,66,67,68,69,70,71,72,2,73,74
%N Lexicographically earliest infinite sequence such that a(i) = a(j) => f(i) = f(j), where f(1) = 1, and for n>1, f(n) = [A003415(n), A085731(n), A373148(n)], for all i, j >= 1.
%C Restricted growth sequence transform of the function f defined as: f(1) = 1, and for n>1, f(n) = [A003415(n), A085731(n), A373148(n)].
%C For all i, j >= 1:
%C A305800(i) = A305800(j) => a(i) = a(j),
%C a(i) = a(j) => A369051(i) = A369051(j),
%C a(i) = a(j) => A373151(i) = A373151(j) => A373143(i) = A373143(j).
%H Antti Karttunen, <a href="/A373150/b373150.txt">Table of n, a(n) for n = 1..100000</a>
%o (PARI)
%o up_to = 100000;
%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 A003415(n) = if(n<=1, 0, my(f=factor(n)); n*sum(i=1, #f~, f[i, 2]/f[i, 1]));
%o A085731(n) = gcd(A003415(n),n);
%o A002110(n) = prod(i=1,n,prime(i));
%o A276085(n) = { my(f = factor(n)); sum(k=1, #f~, f[k, 2]*A002110(primepi(f[k, 1])-1)); };
%o A373148(n) = (A276085(n)%A003415(n));
%o Aux373150(n) = if(1==n,1,[A003415(n), A085731(n), A373148(n)]);
%o v373150 = rgs_transform(vector(up_to, n, Aux373150(n)));
%o A373150(n) = v373150[n];
%Y Cf. A003415, A002110, A085731, A276085, A373148.
%Y Cf. A305800, A369051, A373143, A373151.
%Y Differs from A369050 for the first time at n=91, where a(91)=67, while A369050(91)=37.
%Y Differs from A300833 for the first time at n=133, where a(133)=133, while A300833(133)=50.
%K nonn
%O 1,2
%A _Antti Karttunen_, May 27 2024