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 A213196 #17 Feb 16 2025 08:33:17 %S A213196 1,4,2,3,5,6,11,7,8,12,13,9,10,14,15,22,16,17,23,24,18,19,25,26,20,21, %T A213196 27,28,37,29,30,38,39,31,32,40,41,33,34,42,43,35,36,44,45,56,46,47,57, %U A213196 58,48,49,59,60,50,51,61,62,52,53,63,64,54,55,65,66,79 %N A213196 Inverse permutation of A211377. %H A213196 Boris Putievskiy, <a href="/A213196/b213196.txt">Rows n = 1..140 of triangle, flattened</a> %H A213196 Boris Putievskiy, <a href="http://arxiv.org/abs/1212.2732">Transformations [of] Integer Sequences And Pairing Functions</a> arXiv:1212.2732 [math.CO], 2012. %H A213196 Eric Weisstein's World of Mathematics, <a href="https://mathworld.wolfram.com/PairingFunction.html">Pairing functions</a> %H A213196 <a href="/index/Per#IntegerPermutation">Index entries for sequences that are permutations of the natural numbers</a> %F A213196 a(n)=(m1+m2-1)*(m1+m2-2)/2+m1, where %F A213196 m1=(3*i+j-1-(-1)^i+(i+j-2)*(-1)*t)/4, %F A213196 m2=((1+(-1)^i)*((1+(-1)^j)*2*int((j+2)/4)-(-1+(-1)^j)*(2*int((i+4)/4)+2*int(j/2)))-(-1+(-1)^i)*((1+(-1)^j)*(1+2*int(i/4)+2*int(j/2))-(-1+(-1)^j)*(1+2*int(j/4))))/4, %F A213196 i=n-t*(t+1)/2, j=(t*t+3*t+4)/2-n, t=floor((-1+sqrt(8*n-7))/2). %e A213196 The start of the sequence as triangle array read by rows: %e A213196 1; %e A213196 4,2; %e A213196 3,5,6; %e A213196 11,7,8,12; %e A213196 13,9,10,14,15; %e A213196 22,16,17,23,24,18; %e A213196 19,25,26,20,21,27,28; %e A213196 . . . %e A213196 The start of the sequence as array read by rows, the length of row r is 4*r-3. %e A213196 First 2*r-2 numbers are from the row number 2*r-2 of above triangle array. %e A213196 Last 2*r-1 numbers are from the row number 2*r-1 of above triangle array. %e A213196 1; %e A213196 4,2,3,5,6; %e A213196 11,7,8,12,13,9,10,14,15; %e A213196 22,16,17,23,24,18,19,25,26,20,21,27,28; %e A213196 Row number r contains permutation of 4*r-3 numbers from 2*r*r-5*r+4 to 2*r*r-r: 2*r*r-3*r+2, 2*r*r-5*r+4, 2*r*r-5*r+5,... 2*r*r-r-1, 2*r*r-r. %o A213196 (Python) %o A213196 t=int((math.sqrt(8*n-7) - 1)/ 2) %o A213196 i=n-t*(t+1)/2 %o A213196 j=(t*t+3*t+4)/2-n %o A213196 m1=(3*i+j-1-(-1)**i+(i+j-2)*(-1)**(i+j))/4 %o A213196 m2=((1+(-1)**i)*((1+(-1)**j)*2*int((j+2)/4)-(-1+(-1)**j)*(2*int((i+4)/4)+2*int(j/2)))-(-1+(-1)**i)*((1+(-1)**j)*(1+2*int(i/4)+2*int(j/2))-(-1+(-1)**j)*(1+2*int(j/4))))/4 %o A213196 result=(m1+m2-1)*(m1+m2-2)/2+m1 %Y A213196 Cf. A211377. %K A213196 nonn %O A213196 1,2 %A A213196 _Boris Putievskiy_, Mar 01 2013