Year-end appeal: Please make a donation to the OEIS Foundation to support ongoing development and maintenance of the OEIS. We are now in our 61st year, we have over 378,000 sequences, and we’ve reached 11,000 citations (which often say “discovered thanks to the OEIS”).
%I #14 Sep 11 2017 12:05:23
%S 1,2,3,4,3,5,2,6,7,5,2,8,2,9,5,10,3,8,2,8,9,9,3,11,4,9,12,13,3,14,2,
%T 15,5,5,9,16,2,9,5,11,2,17,3,13,8,5,2,18,4,13,5,13,3,11,9,19,5,5,2,20,
%U 2,9,8,21,5,14,2,8,9,17,3,22,2,9,8,13,5,14,2,18,10,9,3,23,5,5,9,19,3,20,9,8,9,9,5,24,2,13,8,25,3,14,2,19,14,5,2,22,2,17
%N Restricted growth sequence transform of ((-1)^A000120(n))*A046523(n); filter combining the parity of binary weight with the prime signature of n.
%C Equally, restricted growth sequence transform of sequence b defined as b(1) = 1; b(n) = A046523(n) + A010060(n) for n > 1, which starts as 1, 3, 2, 5, 2, 6, 3, 9, 4, 6, 3, 12, 3, 7, 6, 17, 2, 12, 3, 12, 7, 7, ...
%H Antti Karttunen, <a href="/A291762/b291762.txt">Table of n, a(n) for n = 1..65537</a>
%o (PARI)
%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 A046523(n) = { my(f=vecsort(factor(n)[, 2], , 4), p); prod(i=1, #f, (p=nextprime(p+1))^f[i]); }; \\ This function from _Charles R Greathouse IV_, Aug 17 2011
%o write_to_bfile(1,rgs_transform(vector(65537,n,((-1)^hammingweight(n))*A046523(n))),"b291762_upto65537.txt");
%o \\ Or alternatively:
%o A010060(n) = (hammingweight(n)%2);
%o f(n) = if(1==n,n,A046523(n)+A010060(n));
%o write_to_bfile(1,rgs_transform(vector(16385,n,f(n))),"b291762.txt");
%Y Cf. A000120, A010060, A046523.
%Y Cf. A101296, A286163, A291761 (related or similar filtering sequences).
%Y Cf. A027697 (positions of 2's), A027699 (of 3's), A130593 (of 5's and 7's), A230095 (of 9's).
%Y Cf. also A231431, A235001.
%K nonn
%O 1,2
%A _Antti Karttunen_, Sep 11 2017