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 #11 Apr 27 2018 04:14:02
%S 1,2,3,4,2,3,2,5,6,4,2,7,4,7,4,3,5,4,2,7,4,8,9,6,7,7,10,3,7,10,5,11,9,
%T 9,2,7,4,8,12,4,7,8,12,13,8,9,7,14,4,7,10,3,7,6,7,15,12,9,5,15,4,14,
%U 16,9,11,4,2,7,12,8,9,4,7,8,9,4,8,10,7,14,12,8,12,12,8,12,8,17,4,18,7,19,12,17,4,9,14,7,12,3,7,10,7,15,12,12
%N Restricted growth sequence transform of A278222(A302793(n)).
%H Antti Karttunen, <a href="/A302795/b302795.txt">Table of n, a(n) for n = 0..65537</a>
%H <a href="/index/Bi#binary">Index entries for sequences related to binary expansion of n</a>
%o (PARI)
%o rgs_transform(invec) = { my(occurrences = Map(), outvec = vector(length(invec)), u=1); for(i=1, length(invec), if(mapisdefined(occurrences,invec[i]), my(pp = mapget(occurrences, invec[i])); outvec[i] = outvec[pp] , mapput(occurrences,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 A005940(n) = { my(p=2, t=1); n--; until(!n\=2, if((n%2), (t*=p), p=nextprime(p+1))); t }; \\ After code in A005940
%o A046523(n) = { my(f=vecsort(factor(n)[, 2], , 4), p); prod(i=1, #f, (p=nextprime(p+1))^f[i]); }; \\ From A046523
%o A278222(n) = A046523(A005940(1+n));
%o A193231(n) = { my(x='x); subst(lift(Mod(1, 2)*subst(Pol(binary(n), x), x, 1+x)), x, 2) }; \\ From A193231
%o A302793(n) = if(!n,n,A193231(1+A193231(n-1)));
%o write_to_bfile(0,rgs_transform(vector(65538,n,A278222(A302793(n-1)))),"b302795.txt");
%Y Cf. A278222, A302793.
%Y Cf. also A286602, A286622 (compare the scatter-plots).
%K nonn,base,look
%O 0,2
%A _Antti Karttunen_, Apr 26 2018