%I #9 Dec 28 2017 19:34:42
%S 1,2,3,2,4,5,6,5,5,7,8,9,10,11,3,12,13,5,14,15,16,17,18,19,12,20,12,
%T 21,22,12,23,24,25,26,9,12,27,28,29,30,31,32,33,34,19,35,36,37,24,12,
%U 38,39,40,12,41,42,43,44,45,4,46,47,30,48,49,50,51,52,53,7,54,24,55,56,12,57,58,59,60,61,24,62,63,64,65,66,67,68,69,19
%N Restricted growth sequence transform of A297171, which is Möbius transform of A243071.
%H Antti Karttunen, <a href="/A297161/b297161.txt">Table of n, a(n) for n = 1..8192</a>
%o (PARI)
%o up_to = 8192;
%o rgs_transform(invec) = { my(occurrences = Map(), outvec = vector(length(invec)), u=1); for(i=1, length(invec), if(mapisdefined(occurrences,invec[i]), my(pp = mapget(occurrences, invec[i])); outvec[i] = outvec[pp] , mapput(occurrences,invec[i],i); outvec[i] = u; u++ )); outvec; };
%o write_to_bfile(start_offset,vec,bfilename) = { for(n=1, length(vec), write(bfilename, (n+start_offset)-1, " ", vec[n])); }
%o A064989(n) = {my(f); f = factor(n); if((n>1 && f[1,1]==2), f[1,2] = 0); for (i=1, #f~, f[i,1] = precprime(f[i,1]-1)); factorback(f)};
%o A243071(n) = if(n<=2, n-1, if(!(n%2), 2*A243071(n/2), 1+(2*A243071(A064989(n)))));
%o A297171(n) = sumdiv(n,d,moebius(n/d)*A243071(d));
%o write_to_bfile(1,rgs_transform(vector(up_to,n,A297171(n))),"b297161.txt");
%Y Cf. A243071, A297171.
%Y Cf. also A297113, A297157, A297162.
%K nonn
%O 1,2
%A _Antti Karttunen_, Dec 27 2017