%I #5 Dec 26 2018 21:36:03
%S 1,2,3,4,3,5,3,6,5,7,3,8,3,9,8,10,3,11,3,12,12,13,3,14,7,15,9,16,3,17,
%T 3,18,14,19,11,20,3,21,22,23,3,24,3,25,26,27,3,28,17,29,30,31,3,32,23,
%U 33,34,35,3,36,3,37,38,39,28,40,3,22,41,42,3,43,3,44,45,46,20,47,3,48,49,50,3,51,52,53,54,55,3,56,29,57,58,59,60,61,3,62,15
%N Lexicographically earliest such sequence a that a(i) = a(j) => f(i) = f(j) for all i, j, where f(n) = -1 if n is an odd prime, and f(n) = A285330(n) for all other numbers.
%H Antti Karttunen, <a href="/A322807/b322807.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 A007947(n) = factorback(factorint(n)[, 1]); \\ From A007947
%o A048675(n) = my(f = factor(n)); sum(k=1, #f~, f[k, 2]*2^primepi(f[k, 1]))/2; \\ From A048675
%o A285328(n) = { my(r); if((n > 1 && !bitand(n,(n-1))), (n/2), r=A007947(n); if(r==n,1,n = n-r; while(A007947(n) <> r, n = n-r); n)); };
%o A285330(n) = if(issquarefree(n),A048675(n),A285328(n));
%o A322807aux(n) = if((n%2)&&isprime(n),-1,A285330(n));
%o v322807 = rgs_transform(vector(up_to,n,A322807aux(n)));
%o A322807(n) = v322807[n];
%Y Cf. A048675, A285328, A285330, A285332, A322806.
%K nonn
%O 1,2
%A _Antti Karttunen_, Dec 26 2018