login
Lexicographically earliest sequence such that a(i) = a(j) => A323905(i) = A323905(j), for all i, j >= 1.
2

%I #6 Feb 12 2019 22:37:03

%S 1,1,1,2,1,3,1,4,3,4,1,5,1,6,4,7,1,6,1,8,6,9,1,10,4,11,6,12,1,13,1,14,

%T 9,15,6,16,1,17,11,11,1,14,1,18,13,19,1,20,6,9,15,21,1,22,9,23,17,24,

%U 1,25,1,26,14,27,11,28,1,29,19,30,1,31,1,32,9,33,9,34,1,35,22,36,1,37,15,38,24,39,1,40,11,41,26,42,17,43,1,11,28,20,1,44,1,45,30

%N Lexicographically earliest sequence such that a(i) = a(j) => A323905(i) = A323905(j), for all i, j >= 1.

%C Restricted growth sequence transform of A323905.

%H Antti Karttunen, <a href="/A323906/b323906.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 A048675(n) = { my(f = factor(n)); sum(k=1, #f~, f[k, 2]*2^primepi(f[k, 1]))/2; }; \\ From A048675

%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 A156552(n) = if(1==n, 0, if(!(n%2), 1+(2*A156552(n/2)), 2*A156552(A064989(n))));

%o A323905(n) = (A156552(n) - A048675(n));

%o v323906 = rgs_transform(vector(up_to,n,A323905(n)));

%o A323906(n) = v323906[n];

%Y Cf. A048675, A156552, A323905.

%K nonn

%O 1,4

%A _Antti Karttunen_, Feb 12 2019