cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

A291762 Restricted growth sequence transform of ((-1)^A000120(n))*A046523(n); filter combining the parity of binary weight with the prime signature of n.

This page as a plain text file.
%I A291762 #14 Sep 11 2017 12:05:23
%S A291762 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 A291762 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 A291762 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 A291762 Restricted growth sequence transform of ((-1)^A000120(n))*A046523(n); filter combining the parity of binary weight with the prime signature of n.
%C A291762 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 A291762 Antti Karttunen, <a href="/A291762/b291762.txt">Table of n, a(n) for n = 1..65537</a>
%o A291762 (PARI)
%o A291762 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 A291762 write_to_bfile(start_offset,vec,bfilename) = { for(n=1, length(vec), write(bfilename, (n+start_offset)-1, " ", vec[n])); }
%o A291762 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 A291762 write_to_bfile(1,rgs_transform(vector(65537,n,((-1)^hammingweight(n))*A046523(n))),"b291762_upto65537.txt");
%o A291762 \\ Or alternatively:
%o A291762 A010060(n) = (hammingweight(n)%2);
%o A291762 f(n) = if(1==n,n,A046523(n)+A010060(n));
%o A291762 write_to_bfile(1,rgs_transform(vector(16385,n,f(n))),"b291762.txt");
%Y A291762 Cf. A000120, A010060, A046523.
%Y A291762 Cf. A101296, A286163, A291761 (related or similar filtering sequences).
%Y A291762 Cf. A027697 (positions of 2's), A027699 (of 3's), A130593 (of 5's and 7's), A230095 (of 9's).
%Y A291762 Cf. also A231431, A235001.
%K A291762 nonn
%O A291762 1,2
%A A291762 _Antti Karttunen_, Sep 11 2017