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.

A214870 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 counterclockwise. T(n,k) read by antidiagonals.

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