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.
%I A302791 #10 Apr 16 2018 22:11:29 %S A302791 1,2,2,2,2,3,2,4,2,4,2,3,2,4,4,2,2,4,2,3,4,4,2,5,2,4,4,4,2,6,2,4,4,4, %T A302791 3,4,2,4,4,6,2,6,2,4,4,4,2,4,2,4,4,4,2,6,4,7,4,4,2,5,2,4,3,4,4,6,2,4, %U A302791 4,6,2,7,2,4,4,4,4,6,2,4,2,4,2,6,4,4,4,7,2,7,4,4,4,4,4,6,2,4,3,4,2,6,2,7,6 %N A302791 A filter sequence for Fermi-Dirac factorization: restricted growth sequence transform of A046523(A302024(n)). %C A302791 For all i, j: a(i) = a(j) => A064547(i) = A064547(j). %C A302791 For all i, j: a(i) = a(j) => A302790(i) = A302790(j). %C A302791 See also comments in A302024. %H A302791 Antti Karttunen, <a href="/A302791/b302791.txt">Table of n, a(n) for n = 1..65537</a> %o A302791 (PARI) %o A302791 allocatemem(2^30); %o A302791 up_to = 65537; %o A302791 v050376 = vector(up_to); %o A302791 A050376(n) = v050376[n]; %o A302791 ispow2(n) = (n && !bitand(n,n-1)); %o A302791 i = 0; for(n=1,oo,if(ispow2(isprimepower(n)), i++; v050376[i] = n); if(i == up_to,break)); %o A302791 A052331(n) = { my(s=0,e); while(n > 1, fordiv(n, d, if(((n/d)>1)&&ispow2(isprimepower(n/d)), e = vecsearch(v050376, n/d); if(!e, print("v050376 too short!"); return(1/0)); s += 2^(e-1); n = d; break))); (s); }; %o A302791 A005940(n) = { my(p=2, t=1); n--; until(!n\=2, if((n%2), (t*=p), p=nextprime(p+1))); t }; \\ Modified from code of _M. F. Hasler_ %o A302791 A302024(n) = A005940(1+A052331(n)); %o A302791 A046523(n) = { my(f=vecsort(factor(n)[, 2], , 4), p); prod(i=1, #f, (p=nextprime(p+1))^f[i]); }; \\ From A046523 %o A302791 Aux302791(n) = A046523(A302024(n)); %o A302791 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 A302791 write_to_bfile(start_offset,vec,bfilename) = { for(n=1, length(vec), write(bfilename, (n+start_offset)-1, " ", vec[n])); } %o A302791 write_to_bfile(1,rgs_transform(vector(up_to,n,Aux302791(n))),"b302791.txt"); %Y A302791 Cf. A037445, A046523, A050376 (gives the positions of 2's), A052331, A064547, A293442, A302024, A302787, A302790. %K A302791 nonn %O A302791 1,2 %A A302791 _Antti Karttunen_, Apr 15 2018