%I #28 Nov 29 2023 08:13:09
%S 1,5,6,4,3,2,12,13,14,15,11,10,9,8,7,23,24,25,26,27,28,22,21,20,19,18,
%T 17,16,38,39,40,41,42,43,44,45,37,36,35,34,33,32,31,30,29,57,58,59,60,
%U 61,62,63,64,65,66,56,55,54,53,52,51,50,49,48,47,46,80
%N T(n,k) = ((n+k)^2-2*(n+k)+4-(3*n+k-2)*(-1)^(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). Let m be natural number. The order of the list:
%C T(1,1)=1;
%C T(3,1), T(2,2), T(1,3);
%C T(1,2), T(2,1);
%C . . .
%C T(2*m+1,1), T(2*m,2), T(2*m-1,3),...T(2,2*m), T(1,2*m+1);
%C T(1,2*m), T(2,2*m-1), T(3,2*m-2),...T(2*m-1,2),T(2*m,1);
%C . . .
%C First row contains antidiagonal {T(1,2*m+1), ... T(2*m+1,1)}, read upwards.
%C Second row contains antidiagonal {T(1,2*m), ... T(2*m,1)}, read downwards.
%H Boris Putievskiy, <a href="/A221216/b221216.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 As table
%F T(n,k) = ((n+k)^2-2*(n+k)+4-(3*n+k-2)*(-1)^(n+k))/2.
%F As linear sequence
%F a(n) = (A003057(n)^2-2*A003057(n)+4-(3*A002260(n)+A004736(n)-2)*(-1)^A003056(n))/2; a(n) = ((t+2)^2-2*(t+2)+4-(i+3*j-2)*(-1)^t)/2,
%F where i=n-t*(t+1)/2, j=(t*t+3*t+4)/2-n, t=floor((-1+sqrt(8*n-7))/2).
%e The start of the sequence as table:
%e 1....5...4..12..11..23..22...
%e 6....3..13..10..24..21..39...
%e 2...14...9..25..20..40..35...
%e 15...8..26..19..41..34..60...
%e 7...27..18..42..33..61..52...
%e 28..17..43..32..62..51..85...
%e 16..44..31..63..50..86..73...
%e . . .
%e The start of the sequence as triangle array read by rows:
%e 1;
%e 5,6;
%e 4,3,2;
%e 12,13,14,15;
%e 11,10,9,8,7;
%e 23,24,25,26,27,28;
%e 22,21,20,19,18,17,16;
%e . . .
%e Row number r consecutive contains r numbers.
%e If r is odd, row is decreasing.
%e If r is even, row is increasing.
%o (Python)
%o t=int((math.sqrt(8*n-7) - 1)/ 2)
%o i=n-t*(t+1)/2
%o j=(t*t+3*t+4)/2-n
%o result=((t+2)**2-2*(t+2)+4-(3*i+j-2)*(-1)**t)/2
%Y Cf. A211394, A221215, A002260, A004736, A003057;
%Y table T(n,k) contains: in rows A084849, A096376, A014105, A014107, A168244, A033537, A100040, A100041;
%Y in columns A130883, A000384, A014106, A033816, A100037, A091823, A071355, A100038, A100039,A130861;
%Y main diagonal and parallel diagonals are A058331, A001844, A005893,A046092, A093328, A142463, A090288, A059993, A051890, A001105, A097080, A056220, A137882, A054000.
%K nonn,tabl
%O 1,2
%A _Boris Putievskiy_, Feb 22 2013
|