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 A216250 #21 Feb 16 2025 08:33:18 %S A216250 1,2,3,5,4,6,7,8,11,12,10,9,14,13,15,16,17,20,21,24,25,19,18,23,22,27, %T A216250 26,28,29,30,33,34,37,38,41,42,32,31,36,35,40,39,44,43,45,46,47,50,51, %U A216250 54,55,58,59,62,63,49,48,53,52,57,56,61,60,65,64,66,67 %N A216250 T(n,k) = ((n+k)^2-4*k+3-2*(-1)^n-(-1)^k-(n+k-4)*(-1)^(n+k))/2-3, if k=1 and (n mod 2)=1; T(n,k) = ((n+k)^2-4*k+3-2*(-1)^n-(-1)^k-(n+k-4)*(-1)^(n+k))/2, else. Table T(n,k) read by antidiagonals; n, k > 0. %C A216250 Permutation of the natural numbers. %C A216250 a(n) is a pairing function: a function that reversibly maps Z^{+} x Z^{+} onto Z^{+}, where Z^{+} is the set of integer positive numbers. %C A216250 Enumeration table T(n,k). Let m be natural number. The order of the list: %C A216250 T(1,1)=1; %C A216250 T(1,2), T(2,1), T(2,2), T(1,3), T(3,1); %C A216250 . . . %C A216250 T(1,2*m), T(2,2*m-1), T(2,2*m), T(1,2*m+1), T(3,2*m-2), ... T(2*m-1,2), T(2*m,1), T(2*m,2), T(2*m-1,3), T(2*m+1,1); %C A216250 . . . %C A216250 Movement along two adjacent antidiagonals - step to the southwest, step east, step to the northeast, 3 steps to the west, 2 steps to the south and so on. The length of each step is 1. %H A216250 Boris Putievskiy, <a href="/A216250/b216250.txt">Rows n = 1..140 of triangle, flattened</a> %H A216250 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 A216250 Eric Weisstein's World of Mathematics, <a href="https://mathworld.wolfram.com/PairingFunction.html">Pairing functions</a> %H A216250 <a href="/index/Per#IntegerPermutation">Index entries for sequences that are permutations of the natural numbers</a> %F A216250 As table %F A216250 T(n,k) = ((n+k)^2-4*k+3-2*(-1)^n-(-1)^k-(n+k-4)*(-1)^(n+k))/2-3, if k=1 and (n mod 2)=1; %F A216250 T(n,k) = ((n+k)^2-4*k+3-2*(-1)^n-(-1)^k-(n+k-4)*(-1)^(n+k))/2, else. %F A216250 As linear sequence %F A216250 a(n) = ((t+2)^2-4*j+3-2*(-1)^i-(-1)^j-(t-2)*(-1)^t)/2-3, if j=1 and (i mod 2)=1; %F A216250 a(n) = ((t+2)^2-4*j+3-2*(-1)^i-(-1)^j-(t-2)*(-1)^t)/2, else; where i=n-t*(t+1)/2, j=(t*t+3*t+4)/2-n, t=floor((-1+sqrt(8*n-7))/2). %e A216250 The start of the sequence as table: %e A216250 1....2...5...7..10..16..19... %e A216250 3....4...8...9..17..18..30... %e A216250 6...11..14..20..23..33..36... %e A216250 12..13..21..22..34..35..51... %e A216250 15..24..27..37..40..54..57... %e A216250 25..26..38..39..55..56..76... %e A216250 28..41..44..58..61..79..82... %e A216250 . . . %e A216250 The start of the sequence as triangular array read by rows: %e A216250 1; %e A216250 2,3; %e A216250 5,4,6; %e A216250 7,8,11,12; %e A216250 10,9,14,13,15; %e A216250 16,17,20,21,24,25; %e A216250 19,18,23,22,27,26,28; %e A216250 . . . %e A216250 The start of the sequence as array read by rows, with length of row r: 4*r-3: %e A216250 First 2*r-2 numbers are from the row number 2*r-2 of above triangle array. %e A216250 Last 2*r-1 numbers are from the row number 2*r-1 of above triangle array. %e A216250 1; %e A216250 2,3,5,4,6; %e A216250 7,8,11,12,10,9,14,13,15; %e A216250 16,17,20,21,24,25,19,18,23,22,27,26,28; %e A216250 . . . %e A216250 Row number r contains permutation of the 4*r-3 numbers from 2*r*r-5*r+4 to 2*r*r-r: 2*r*r-5*r+4, 2*r*r-5*r+5, ...2*r*r-r-2, 2*r*r-r. %o A216250 (Python) %o A216250 t=int((math.sqrt(8*n-7) - 1)/ 2) %o A216250 i=n-t*(t+1)/2 %o A216250 j=(t*t+3*t+4)/2-n %o A216250 result=((t+2)**2-4*j+3-(-1)**j-2*(-1)**i-(t-2)*(-1)**t)/2 %o A216250 if j==1 and (i%2)==1: %o A216250 result=result-3 %Y A216250 Cf. A213205, A213171, A213197, A210521; table T(n,k) contains: in rows A130883, A033816, A100037, A100038, A100039; in columns A000384, A014106, A071355, A091823, A130861. %K A216250 nonn,tabl %O A216250 1,2 %A A216250 _Boris Putievskiy_, Mar 14 2013