%I #11 Dec 08 2017 00:52:28
%S 1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,15,23,24,20,
%T 25,26,27,28,21,29,30,31,30,32,33,23,34,35,36,37,38,39,40,28,30,41,42,
%U 43,44,45,46,47,44,47,48,35,49,50,51,37,52,53,54,55,56,57,58,55,44,59,60,61,62,63,58,50,48,64,65,57,54,66,67,68,69,70,71,72,73,50,74,55,69
%N Filter combining sigma(n) with the parity of n; restricted growth sequence transform of ((-1)^n)*A000203(n).
%H Antti Karttunen, <a href="/A296088/b296088.txt">Table of n, a(n) for n = 1..65537</a>
%e For n = 21 and 31 the restricted growth sequence transform assigns the same value (we have a(21) = a(31) = 21) because both numbers are odd, and the sum of their divisors is equal as sigma(21) = sigma(31) = 32.
%e On the other hand, although sigma(14) = sigma(15) = 24, a(14) != a(15) because the other number is even and the other number is odd. Compare to A286603.
%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 write_to_bfile(start_offset,vec,bfilename) = { for(n=1, length(vec), write(bfilename, (n+start_offset)-1, " ", vec[n])); }
%o write_to_bfile(1,rgs_transform(vector(up_to,n,((-1)^n)*sigma(n))),"b296088.txt");
%Y Cf. A000035, A000203, A286603, A291761, A296089.
%K nonn
%O 1,2
%A _Antti Karttunen_, Dec 07 2017
|