login
Restricted growth sequence transform of A294898.
1

%I #5 Aug 26 2018 20:13:52

%S 1,1,1,1,2,3,4,1,4,1,5,6,7,8,2,1,9,10,11,12,5,13,14,15,16,5,17,18,19,

%T 20,21,1,16,22,23,24,25,26,14,27,28,29,30,8,31,16,32,33,30,34,35,4,36,

%U 20,25,37,38,39,40,41,42,43,16,1,44,15,45,31,46,47,48,49,50,51,39,7,52,20,53,54,30,55,56,57,58,59,60,47,61,62,63,22,40,46,64

%N Restricted growth sequence transform of A294898.

%H Antti Karttunen, <a href="/A318308/b318308.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 A294898(n) = (2*n - sigma(n) - hammingweight(n));

%o v318308 = rgs_transform(vector(up_to,n,A294898(n)));

%o A318308(n) = v318308[n];

%Y Cf. A294898, A286449, A318309, A318310.

%K nonn

%O 1,5

%A _Antti Karttunen_, Aug 26 2018