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.

A211377 T(n,k) = ((k + n)^2 - 4*k + 3 + (-1)^k - (k + n - 2)*(-1)^(k + n))/2; n, k > 0, read by antidiagonals.

This page as a plain text file.
%I A211377 #29 Feb 16 2025 08:33:17
%S A211377 1,3,4,2,5,6,8,9,12,13,7,10,11,14,15,17,18,21,22,25,26,16,19,20,23,24,
%T A211377 27,28,30,31,34,35,38,39,42,43,29,32,33,36,37,40,41,44,45,47,48,51,52,
%U A211377 55,56,59,60,63,64,46,49,50,53,54,57,58,61,62,65,66,68
%N A211377 T(n,k) = ((k + n)^2 - 4*k + 3 + (-1)^k - (k + n - 2)*(-1)^(k + n))/2; n, k > 0, read by antidiagonals.
%C A211377 Permutation of the natural numbers.
%C A211377 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 A211377 Enumeration table T(n,k). The order of the list:
%C A211377 T(1,1)=1;
%C A211377 T(1,3), T(1,2), T(2,1), T(2,2), T(3,1);
%C A211377 ...
%C A211377 T(1,n), T(1,n-1), T(2,n-2), T(2,n-1), T(3,n-2), T(3,n-3)...T(n,1);
%C A211377 ...
%C A211377 Descent by snake along two adjacent antidiagonal - step to the west, step to the southwest, step to the east, step to the southwest and so on.  The length of each step is 1.
%C A211377 Table contains:
%C A211377 row 1 is alternation of elements A130883 and A033816,
%C A211377 row 2 accommodates elements A100037 in odd places;
%C A211377 column 1 is alternation of elements A000384 and A091823,
%C A211377 column 2 is alternation of elements A071355 and A014106,
%C A211377 column 3 accommodates elements A130861 in even places;
%C A211377 main diagonal accommodates elements A188135 in odd places,
%C A211377 diagonal 1, located above the main diagonal, is alternation of elements A033567 and A033566,
%C A211377 diagonal 2, located above the main diagonal, is alternation of elements A139271 and A033585.
%H A211377 Boris Putievskiy, <a href="/A211377/b211377.txt">Rows n = 1..140 of triangle, flattened</a>
%H A211377 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 A211377 Eric W. Weisstein, <a href="https://mathworld.wolfram.com/PairingFunction.html">MathWorld: Pairing functions</a>
%H A211377 <a href="/index/Per#IntegerPermutation">Index entries for sequences that are permutations of the natural numbers</a>
%F A211377 As a table:
%F A211377 T(n,k) = ((k + n)^2 - 4*k + 3 + (-1)^k - (k + n - 2)*(-1)^(k + n))/2.
%F A211377 As a linear sequence:
%F A211377 a(n) = ((t + 2)^2 - 4*j + 3 + (-1)^j - t*(-1)^t)/2, where j = (t*t + 3*t + 4)/2 - n and t = int((sqrt(8*n - 7) - 1)/ 2).
%e A211377 The start of the sequence as a table:
%e A211377    1,  3,  2,   8,   7,  17,  16,  30,  29,  47,  46, ...
%e A211377    4,  5,  9,  10,  18,  19,  31,  32,  48,  49,  69, ...
%e A211377    6, 12, 11,  21,  20,  34,  33,  51,  50,  72,  71, ...
%e A211377   13, 14, 22,  23,  35,  36,  52,  53,  73,  74,  98, ...
%e A211377   15, 25, 24,  38,  37,  55,  54,  76,  75, 101, 100, ...
%e A211377   26, 27, 39,  40,  56,  57,  77,  78, 102, 103, 131, ...
%e A211377   28, 42, 41,  59,  58,  80,  79, 105, 104, 134, 133, ...
%e A211377   43, 44, 60,  61,  81,  82, 106, 107, 135, 136, 168, ...
%e A211377   45, 63, 62,  84,  83, 109, 108, 138, 137, 171, 170, ...
%e A211377   64, 65, 85,  86, 110, 111, 139, 140, 172, 173, 209, ...
%e A211377   66, 88, 87, 113, 112, 142, 141, 175, 174, 212, 211, ...
%e A211377   ...
%e A211377 The start of the sequence as triangle array read by rows:
%e A211377    1;
%e A211377    3,  4;
%e A211377    2,  5,  6;
%e A211377    8,  9, 12, 13;
%e A211377    7, 10, 11, 14, 15;
%e A211377   17, 18, 21, 22, 25, 26;
%e A211377   16, 19, 20, 23, 24, 27, 28;
%e A211377   30, 31, 34, 35, 38, 39, 42, 43;
%e A211377   29, 32, 33, 36, 37, 40, 41, 44, 45;
%e A211377   47, 48, 51, 52, 55, 56, 59, 60, 63, 64;
%e A211377   46, 49, 50, 53, 54, 57, 58, 61, 62, 65, 66;
%e A211377   ...
%e A211377 The start of the sequence as an array read by rows, the length of row r is 4*r-3.
%e A211377 First 2*r-2 numbers are from row number 2*r-2 of the triangular array above.
%e A211377 Last  2*r-1 numbers are from row number 2*r-1 of the triangular array above.
%e A211377    1;
%e A211377    3,  4,  2,  5,  6;
%e A211377    8,  9, 12, 13,  7, 10, 11, 14, 15;
%e A211377   17, 18, 21, 22, 25, 26, 16, 19, 20, 23, 24, 27, 28;
%e A211377   30, 31, 34, 35, 38, 39, 42, 43, 29, 32, 33, 36, 37, 40, 41, 44, 45;
%e A211377   47, 48, 51, 52, 55, 56, 59, 60, 63, 64, 46, 49, 50, 53, 54, 57, 58, 61, 62, 65, 66;
%e A211377   ...
%e A211377 Row number r contains permutation 4*r-3 numbers from 2*r*r-5*r+4 to 2*r*r-r:
%e A211377 2*r*r-5*r+5, 2*r*r-5*r+6,...2*r*r-r-4, 2*r*r-r-1, 2*r*r-r.
%t A211377 T[n_, k_] := ((k+n)^2 - 4k + 3 + (-1)^k - (k+n-2)(-1)^(k+n))/2;
%t A211377 Table[T[n-k+1, k], {n, 1, 12}, {k, n, 1, -1}] // Flatten (* _Jean-François Alcover_, Nov 29 2018 *)
%o A211377 (Python)
%o A211377 t=int((math.sqrt(8*n-7) - 1)/ 2)
%o A211377 i=n-t*(t+1)/2
%o A211377 j=(t*t+3*t+4)/2-n
%o A211377 result=((t+2)**2-4*j+3+(-1)**j-t*(-1)**(t+2))/2
%Y A211377 Cf. A000384, A014106, A033566, A033567, A033585, A033816, A071355, A091823, A100037, A130861, A130883, A139271, A188135.
%K A211377 nonn,tabl
%O A211377 1,2
%A A211377 _Boris Putievskiy_, Feb 07 2013