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 A331307 #9 Jan 19 2020 20:38:24 %S A331307 1,2,2,3,4,5,6,5,3,7,8,9,4,9,10,11,12,7,6,13,14,15,16,13,4,12,17,18, %T A331307 19,20,21,10,8,21,22,23,24,25,26,17,4,16,27,28,29,30,31,32,27,14,11, %U A331307 26,33,34,35,36,37,38,39,22,4,20,39,40,41,42,43,44,45,46,33,18,15,32,47,48,49,50,51,52,53,54,47,28,4,25,46,55,56,57,58,59,60,61,62,63,40,23,19,38 %N A331307 Lexicographically earliest infinite sequence such that for all i, j: a(i) = a(j) => f(i) = f(j), where f(n) = A285722(n), except f(1) = -1. %C A331307 Restricted growth sequence transform of function: f(1) = -1, and for n>1, f(n) = A285722(n), when the latter is considered as an one-dimensional sequence. %C A331307 For all i, j: %C A331307 A331306(i) = A331306(j) => a(i) = a(j) => A072030(i) = A072030(j). %H A331307 Antti Karttunen, <a href="/A331307/b331307.txt">Table of n, a(n) for n = 1..25425</a> %o A331307 (PARI) %o A331307 up_to = 25425; \\ = binomial(225+1,2) %o A331307 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 A331307 A000027pairton(a,b) = ((2+((a+b)^2 - a) - (3*b))/2); %o A331307 A285722sq(n, k) = if(n==k,0,if(n>k,A000027pairton(n-k,k),A000027pairton(n,k-n))); %o A331307 A285722list(up_to) = { my(v = vector(up_to), i=0); for(a=1,oo, for(col=1,a, i++; if(i > up_to, return(v)); v[i] = A285722sq(col,(a-(col-1))))); (v); }; %o A331307 v285722 = A285722list(up_to); %o A331307 A285722(n) = v285722[n]; %o A331307 A331307aux(n) = if(1==n,-n,A285722(n)); %o A331307 v331307 = rgs_transform(vector(up_to, n, A331307aux(n))); %o A331307 A331307(n) = v331307[n]; %Y A331307 Cf. A072030, A285722. %Y A331307 Cf. also A331305, A331306. %K A331307 nonn,tabl %O A331307 1,2 %A A331307 _Antti Karttunen_, Jan 19 2020