A291762 Restricted growth sequence transform of ((-1)^A000120(n))*A046523(n); filter combining the parity of binary weight with the prime signature of n.
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, 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, 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
Offset: 1
Keywords
Links
- Antti Karttunen, Table of n, a(n) for n = 1..65537
Crossrefs
Programs
-
PARI
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; }; write_to_bfile(start_offset,vec,bfilename) = { for(n=1, length(vec), write(bfilename, (n+start_offset)-1, " ", vec[n])); } 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 write_to_bfile(1,rgs_transform(vector(65537,n,((-1)^hammingweight(n))*A046523(n))),"b291762_upto65537.txt"); \\ Or alternatively: A010060(n) = (hammingweight(n)%2); f(n) = if(1==n,n,A046523(n)+A010060(n)); write_to_bfile(1,rgs_transform(vector(16385,n,f(n))),"b291762.txt");
Comments