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