Reminder: The OEIS is hiring a new managing editor, and the application deadline is January 26.
%I #27 Jul 08 2024 22:14:07
%S 1,5,6,2,3,4,12,13,14,15,7,8,9,10,11,23,24,25,26,27,28,16,17,18,19,20,
%T 21,22,38,39,40,41,42,43,44,45,29,30,31,32,33,34,35,36,37,57,58,59,60,
%U 61,62,63,64,65,66,46,47,48,49,50,51,52,53,54,55,56,80
%N T(n,k) = (k+n)*(k+n-1)/2-(k+n-1)*(-1)^(k+n)-k+2; n , k > 0, read by antidiagonals.
%C Permutation of the natural numbers.
%C 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 Enumeration table T(n,k). The order of the list:
%C T(1,1)=1;
%C T(1,3), T(2,2), T(3,1);
%C T(1,2), T(2,1);
%C . . .
%C T(1,n), T(2,n-1), T(3,n-2), ... T(n,1);
%C T(1,n-1), T(2,n-3), T(3,n-4),...T(n-1,1);
%C . . .
%C First row matches with the elements antidiagonal {T(1,n), ... T(n,1)},
%C second row matches with the elements antidiagonal {T(1,n-1), ... T(n-1,1)}.
%C Table contains:
%C row 1 is alternation of elements A130883 and A096376,
%C row 2 accommodates elements A033816 in even places,
%C row 3 accommodates elements A100037 in odd places,
%C row 5 accommodates elements A100038 in odd places;
%C column 1 is alternation of elements A084849 and A000384,
%C column 2 is alternation of elements A014106 and A014105,
%C column 3 is alternation of elements A014107 and A091823,
%C column 4 is alternation of elements A071355 and |A168244|,
%C column 5 accommodates elements A033537 in even places,
%C column 7 is alternation of elements A100040 and A130861,
%C column 9 accommodates elements A100041 in even places;
%C the main diagonal is A058331,
%C diagonal 1, located above the main diagonal is A001844,
%C diagonal 2, located above the main diagonal is A001105,
%C diagonal 3, located above the main diagonal is A046092,
%C diagonal 4, located above the main diagonal is A056220,
%C diagonal 5, located above the main diagonal is A142463,
%C diagonal 6, located above the main diagonal is A054000,
%C diagonal 7, located above the main diagonal is A090288,
%C diagonal 9, located above the main diagonal is A059993,
%C diagonal 10, located above the main diagonal is |A147973|,
%C diagonal 11, located above the main diagonal is A139570;
%C diagonal 1, located under the main diagonal is A051890,
%C diagonal 2, located under the main diagonal is A005893,
%C diagonal 3, located under the main diagonal is A097080,
%C diagonal 4, located under the main diagonal is A093328,
%C diagonal 5, located under the main diagonal is A137882.
%H Boris Putievskiy, <a href="/A211394/b211394.txt">Rows n = 1..140 of triangle, flattened</a>
%H 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 Eric Weisstein's World of Mathematics, <a href="http://mathworld.wolfram.com/PairingFunction.html">Pairing functions</a>
%H <a href="/index/Per#IntegerPermutation">Index entries for sequences that are permutations of the natural numbers</a>
%F T(n,k) = (k+n)*(k+n-1)/2-(k+n-1)*(-1)^(k+n)-k+2.
%F As linear sequence
%F a(n) = A003057(n)*A002024(n)/2- A002024(n)*(-1)^A003056(n)-A004736(n)+2.
%F a(n) = (t+2)*(t+1)/2 - (t+1)*(-1)^t-j+2, where j=(t*t+3*t+4)/2-n and t=int((math.sqrt(8*n-7) - 1)/ 2).
%e The start of the sequence as table:
%e 1....5...2..12...7..23..16...
%e 6....3..13...8..24..17..39...
%e 4...14...9..25..18..40..31...
%e 15..10..26..19..41..32..60...
%e 11..27..20..42..33..61..50...
%e 28..21..43..34..62..51..85...
%e 22..44..35..63..52..86..73...
%e . . .
%e The start of the sequence as triangle array read by rows:
%e 1;
%e 5,6;
%e 2,3,4;
%e 12,13,14,15;
%e 7,8,9,10,11;
%e 23,24,25,26,27,28;
%e 16,17,18,19,20,21,22;
%e . . .
%e Row number r matches with r numbers segment {(r+1)*r/2-r*(-1)^(r+1)-r+2,... (r+1)*r/2-r*(-1)^(r+1)+1}.
%t T[n_, k_] := (n+k)(n+k-1)/2 - (-1)^(n+k)(n+k-1) - k + 2;
%t Table[T[n-k+1, k], {n, 1, 12}, {k, n, 1, -1}] // Flatten (* _Jean-François Alcover_, Dec 06 2018 *)
%o (Python)
%o t=int((math.sqrt(8*n-7) - 1)/ 2)
%o j=(t*t+3*t+4)/2-n
%o result=(t+2)*(t+1)/2-(t+1)*(-1)**t-j+2
%Y Cf. A130883, A096376, A033816, A100037, A100038, A084849, A000384, A014106, A014105, A014107, A091823, A071355, A168244, A033537, A100040, A130861, A100041, A058331, A001844, A001105, A046092, A056220, A142463, A054000, A090288, A059993, A147973, A139570, A051890, A005893, A097080, A093328, A137882.
%K nonn,tabl
%O 1,2
%A _Boris Putievskiy_, Feb 08 2013