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 A297157 #6 Dec 28 2017 19:34:06 %S A297157 1,2,3,2,4,5,6,3,2,7,8,7,9,10,5,11,12,5,13,10,14,15,16,14,2,17,4,15, %T A297157 18,19,20,21,22,23,5,5,24,25,26,22,27,28,29,17,10,30,31,32,2,5,33,23, %U A297157 34,7,35,26,36,37,38,19,39,40,15,41,42,43,44,25,45,19,46,7,47,48,7,30,5,49,50,51,52,53,54,55,56,57,58,33 %N A297157 Restricted growth sequence transform of A297156, which is Möbius transform of A243354. %H A297157 Antti Karttunen, <a href="/A297157/b297157.txt">Table of n, a(n) for n = 1..8192</a> %o A297157 (PARI) %o A297157 up_to = 8192; %o A297157 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 A297157 write_to_bfile(start_offset,vec,bfilename) = { for(n=1, length(vec), write(bfilename, (n+start_offset)-1, " ", vec[n])); } %o A297157 A064989(n) = {my(f); f = factor(n); if((n>1 && f[1,1]==2), f[1,2] = 0); for (i=1, #f~, f[i,1] = precprime(f[i,1]-1)); factorback(f)}; %o A297157 A156552(n) = if(1==n, 0, if(!(n%2), 1+(2*A156552(n/2)), 2*A156552(A064989(n)))); %o A297157 A006068(n)= { my(s=1, ns); while(1, ns = n >> s; if(0==ns, break()); n = bitxor(n, ns); s <<= 1; ); return (n); } \\ Essentially _Joerg Arndt_'s Jul 19 2012 code. %o A297157 A243354(n) = A006068(A156552(n)); %o A297157 A297156(n) = sumdiv(n,d,moebius(n/d)*A243354(d)); %o A297157 write_to_bfile(1,rgs_transform(vector(up_to,n,A297156(n))),"b297157.txt"); %Y A297157 Cf. A006068, A156552, A243354, A297156. %Y A297157 Cf. also A297113, A297161, A297162. %K A297157 nonn %O A297157 1,2 %A A297157 _Antti Karttunen_, Dec 28 2017