login

Reminder: The OEIS is hiring a new managing editor, and the application deadline is January 26.

Restricted growth sequence transform of A320017.
2

%I #5 Nov 08 2018 21:13:49

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

%T 12,13,3,2,14,15,4,2,16,2,8,6,17,2,3,2,4,18,9,2,3,19,5,20,21,2,10,2,

%U 22,7,2,23,24,2,12,25,26,2,3,2,27,6,14,28,29,2,4,2,30,2,16,31,32,33,8,2,10,34,17,35,36,37,3,2,5,11,4,2,38,2,9,39

%N Restricted growth sequence transform of A320017.

%C For all i, j: a(i) = a(j) => A318674(i) = A318674(j).

%H Antti Karttunen, <a href="/A320018/b320018.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 A019565(n) = {my(j,v); factorback(Mat(vector(if(n, #n=vecextract(binary(n), "-1..1")), j, [prime(j), n[j]])~))}; \\ From A019565

%o A320017(n) = if(1==n,n,my(m=1); fordiv(n,d,if(1==moebius(d), m *= A019565(d))); (m));

%o v320018 = rgs_transform(vector(up_to,n,A320017(n)));

%o A320018(n) = v320018[n];

%Y Cf. A320017,

%Y Cf. also A319682.

%K nonn

%O 1,2

%A _Antti Karttunen_, Nov 08 2018