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 A340684 #10 Jul 20 2025 17:40:15 %S A340684 1,2,1,3,4,5,6,7,8,3,9,10,1,11,12,13,14,7,4,15,14,16,9,17,18,19,20,21, %T A340684 22,23,24,25,9,3,8,26,24,11,27,26,28,3,29,30,22,31,1,32,33,34,35,36, %U A340684 14,37,35,38,39,10,40,41,22,42,43,44,45,46,4,15,47,31,40,48,49,50,51,21,52,53,54,55,56,30,24,15 %N A340684 Lexicographically earliest infinite sequence such that a(i) = a(j) => f(i) = f(j), where f(n) = [A291759(n), A278222(A304759(n))], for all i, j >= 1. %C A340684 Restricted growth sequence transform of the ordered pair [A291759(n), A278222(A304759(n))]. %C A340684 For all i, j: a(i) = a(j) => A340383(i) = A340383(j). %H A340684 Antti Karttunen, <a href="/A340684/b340684.txt">Table of n, a(n) for n = 1..65537</a> %o A340684 (PARI) %o A340684 up_to = 65537; %o A340684 A003961(n) = my(f = factor(n)); for (i=1, #f~, f[i, 1] = nextprime(f[i, 1]+1)); factorback(f); \\ From A003961 %o A340684 A048673(n) = (A003961(n)+1)/2; %o A340684 A289814(n) = { my (d=digits(n, 3)); fromdigits(vector(#d, i, if (d[i]==2, 1, 0)), 2); } \\ From A289814 %o A340684 A291759(n) = A289814(A048673(n)); %o A340684 A289813(n) = { my (d=digits(n, 3)); fromdigits(vector(#d, i, if (d[i]==1, 1, 0)), 2); } \\ From A289813 %o A340684 A304759(n) = A289813(A048673(n)); %o A340684 A005940(n) = { my(p=2, t=1); n--; until(!n\=2, if((n%2), (t*=p), p=nextprime(p+1))); (t); }; %o A340684 A046523(n) = { my(f=vecsort(factor(n)[, 2], , 4), p); prod(i=1, #f, (p=nextprime(p+1))^f[i]); }; \\ From A046523 %o A340684 A278222(n) = A046523(A005940(1+n)); %o A340684 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 A340684 Aux340684(n) = [A291759(n),A278222(A304759(n))]; %o A340684 v340684 = rgs_transform(vector(up_to,n,Aux340684(n))); %o A340684 A340684(n) = v340684[n]; %Y A340684 Cf. A048673, A278222, A290093, A291759, A304759, A340383. %K A340684 nonn %O A340684 1,2 %A A340684 _Antti Karttunen_, Jan 16 2021