cp's OEIS Frontend

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.

A213921 Natural numbers placed in table T(n,k) layer by layer. The order of placement: at the beginning filled odd places of layer clockwise, next - even places clockwise. Table T(n,k) read by antidiagonals.

This page as a plain text file.
%I A213921 #24 Feb 16 2025 08:33:17
%S A213921 1,2,3,5,4,7,10,8,9,13,17,14,6,16,21,26,22,11,12,25,31,37,32,18,15,20,
%T A213921 36,43,50,44,27,23,24,30,49,57,65,58,38,33,19,35,42,64,73,82,74,51,45,
%U A213921 28,29,48,56,81,91,101,92,66,59,39,34,41,63,72,100,111
%N A213921 Natural numbers placed in table T(n,k) layer by layer. The order of placement: at the beginning filled odd places of layer clockwise, next - even places clockwise. Table T(n,k) read by antidiagonals.
%C A213921 A permutation of the natural numbers.
%C A213921 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 A213921 Layer is pair of sides of square from T(1,n) to T(n,n) and from T(n,n) to T(n,1). Enumeration table T(n,k) is layer by layer. The order of the list:
%C A213921 T(1,1)=1;
%C A213921 T(1,2), T(2,1), T(2,2);
%C A213921 . . .
%C A213921 T(1,n), T(3,n), ... T(n,3), T(n,1), T(2,n), T(4,n), ... T(n,4), T(n,2);
%C A213921 ...
%H A213921 Boris Putievskiy, <a href="/A213921/b213921.txt">Rows n = 1..140 of triangle, flattened</a>
%H A213921 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 A213921 Eric W. Weisstein, <a href="https://mathworld.wolfram.com/PairingFunction.html">MathWorld: Pairing functions</a>
%H A213921 <a href="/index/Per#IntegerPermutation">Index entries for sequences that are permutations of the natural numbers</a>
%F A213921 As a table:
%F A213921 T(n,k) = n*n - (k mod 2)*n + 2 - floor((k+2)/2), if n>k;
%F A213921 T(n,k) = k*k - ((n mod 2)+1)*k + floor((n+3)/2), if n<=k.
%F A213921 As a linear sequence:
%F A213921 a(n) = i*i - (j mod 2)*i + 2 - floor((j+2)/2), if i>j;
%F A213921 a(n) = j*j - ((i mod 2)+1)*j + floor((i+3)/2), if i<=j; where i = n-t*(t+1)/2, j = (t*t+3*t+4)/2-n, t = floor((-1+sqrt(8*n-7))/2).
%e A213921 The start of the sequence as table:
%e A213921    1   2   5  10  17  26 ...
%e A213921    3   4   8  14  22  32 ...
%e A213921    7   9   6  11  18  27 ...
%e A213921   13  16  12  15  23  33 ...
%e A213921   21  25  20  24  19  28 ...
%e A213921   31  36  30  35  29  34 ...
%e A213921   ...
%e A213921 The start of the sequence as triangle array read by rows:
%e A213921    1;
%e A213921    2,  3;
%e A213921    5,  4,  7;
%e A213921   10,  8,  9, 13;
%e A213921   17, 14,  6, 16, 21;
%e A213921   26, 22, 11, 12, 25, 31;
%e A213921   ...
%o A213921 (Python)
%o A213921 t=int((math.sqrt(8*n-7) - 1)/ 2)
%o A213921 i=n-t*(t+1)/2
%o A213921 j=(t*t+3*t+4)/2-n
%o A213921 if i > j:
%o A213921    result=i*i-(j%2)*i+2-int((j+2)/2)
%o A213921 else:
%o A213921    result=j*j-((i%2)+1)*j + int((i+3)/2)
%Y A213921 Cf. A060734, A060736; table T(n,k) contains: in rows A002522, A014206, A059100, A027688, A117950, A027689, A087475, A027690, A117951, A027691, A114949, A027692, A117619; in columns A002061, A000290, A002378, A005563, A028387, A008865, A028552, A028872, A014209, A028347, A028875.
%K A213921 nonn,tabl
%O A213921 1,2
%A A213921 _Boris Putievskiy_, Mar 05 2013