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 A297161 #9 Dec 28 2017 19:34:42 %S A297161 1,2,3,2,4,5,6,5,5,7,8,9,10,11,3,12,13,5,14,15,16,17,18,19,12,20,12, %T A297161 21,22,12,23,24,25,26,9,12,27,28,29,30,31,32,33,34,19,35,36,37,24,12, %U A297161 38,39,40,12,41,42,43,44,45,4,46,47,30,48,49,50,51,52,53,7,54,24,55,56,12,57,58,59,60,61,24,62,63,64,65,66,67,68,69,19 %N A297161 Restricted growth sequence transform of A297171, which is Möbius transform of A243071. %H A297161 Antti Karttunen, <a href="/A297161/b297161.txt">Table of n, a(n) for n = 1..8192</a> %o A297161 (PARI) %o A297161 up_to = 8192; %o A297161 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 A297161 write_to_bfile(start_offset,vec,bfilename) = { for(n=1, length(vec), write(bfilename, (n+start_offset)-1, " ", vec[n])); } %o A297161 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 A297161 A243071(n) = if(n<=2, n-1, if(!(n%2), 2*A243071(n/2), 1+(2*A243071(A064989(n))))); %o A297161 A297171(n) = sumdiv(n,d,moebius(n/d)*A243071(d)); %o A297161 write_to_bfile(1,rgs_transform(vector(up_to,n,A297171(n))),"b297161.txt"); %Y A297161 Cf. A243071, A297171. %Y A297161 Cf. also A297113, A297157, A297162. %K A297161 nonn %O A297161 1,2 %A A297161 _Antti Karttunen_, Dec 27 2017