# Greetings from The On-Line Encyclopedia of Integer Sequences! http://oeis.org/
Search: id:a209293
Showing 1-1 of 1
%I A209293 #21 Nov 29 2023 06:57:49
%S A209293 1,2,3,5,4,6,8,9,7,10,13,12,14,11,15,18,19,17,20,16,21,25,24,26,23,27,
%T A209293 22,28,32,33,31,34,30,35,29,36,41,40,42,39,43,38,44,37,45,50,51,49,52,
%U A209293 48,53,47,54,46,55,61,60,62,59,63,58,64,57,65,56,66,72,73,71,74,70,75,69,76,68,77,67
%N A209293 Inverse permutation of A185180.
%C A209293 Permutation of the natural numbers. 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 A209293 Enumeration table T(n,k) by diagonals. The order of the list
%C A209293 if n is odd - T(n-1,2),T(n-3,4),...,T(2,n-1),T(1,n),T(3,n-2),...T(n,1).
%C A209293 if n is even - T(n-1,2),T(n-3,4),...,T(3,n-2),T(1,n),T(2,n-1),...T(n,1).
%C A209293 Table T(n,k) contains:
%C A209293 Column number 1 A000217,
%C A209293 column number 2 A000124,
%C A209293 column number 3 A000096,
%C A209293 column number 4 A152948,
%C A209293 column number 5 A034856,
%C A209293 column number 6 A152950,
%C A209293 column number 7 A055998.
%C A209293 Row numder 1 A000982,
%C A209293 row number 2 A097063.
%H A209293 Boris Putievskiy, Rows n = 1..140 of triangle, flattened
%H A209293 Boris Putievskiy, Transformations [of] Integer Sequences And Pairing Functions arXiv:1212.2732 [math.CO], 2012.
%H A209293 Eric Weisstein's World of Mathematics, Pairing functions
%H A209293 Index entries for sequences that are permutations of the natural numbers
%F A209293 As table T(n,k) read by antidiagonals
%F A209293 T(n,k) = n*n/2+4*(floor((k-1)/2)+1)*n+ceiling((k-1)^2/2), n,k > 0.
%F A209293 As linear sequence
%F A209293 a(n) = (m1+m2-1)*(m1+m2-2)/2+m1, where
%F A209293 m1 = int((i+j)/2)+int(i/2)*(-1)^(i+t+1),
%F A209293 m2 = int((i+j+1)/2)+int(i/2)*(-1)^(i+t),
%F A209293 t = int((math.sqrt(8*n-7) - 1)/ 2),
%F A209293 i = n-t*(t+1)/2,
%F A209293 j = (t*t+3*t+4)/2-n.
%e A209293 The start of the sequence as table:
%e A209293 1....2...5...8..13..18...25...32...41...
%e A209293 3....4...9..12..19..24...33...40...51...
%e A209293 6....7..14..17..26..31...42...49...62...
%e A209293 10..11..20..23..34..39...52...59...74...
%e A209293 15..16..27..30..43..48...63...70...87...
%e A209293 21..22..35..38..53..58...75...82..101...
%e A209293 28..29..44..47..64..69...88...95..116...
%e A209293 36..37..54..57..76..81..102..109..132...
%e A209293 45..46..65..68..89..94..117..124..149...
%e A209293 . . .
%e A209293 The start of the sequence as triangle array read by rows:
%e A209293 1;
%e A209293 2,3;
%e A209293 5,4,6;
%e A209293 8,9,7,10;
%e A209293 13,12,14,11,15;
%e A209293 18,19,17,20,16,21;
%e A209293 25,24,26,23,27,22,28;
%e A209293 32,33,31,34,30,35,29,36;
%e A209293 41,40,42,39,43,38,44,37,45;
%e A209293 . . .
%e A209293 Row number r contains permutation from r numbers:
%e A209293 if r is odd ceiling(r^2/2), ceiling(r^2/2)+1, ceiling(r^2/2)-1, ceiling(r^2/2)+2, ceiling(r^2/2)-2,...r*(r+1)/2;
%e A209293 if r is even ceiling(r^2/2), ceiling(r^2/2)-1, ceiling(r^2/2)+1, ceiling(r^2/2)-2, ceiling(r^2/2)+2,...r*(r+1)/2;
%t A209293 max = 10; row[n_] := Table[Ceiling[(n + k - 1)^2/2] + If[OddQ[k], 1, -1]*Floor[n/2], {k, 1, max}]; t = Table[row[n], {n, 1, max}]; Table[t[[n - k + 1, k]], {n, 1, max}, {k, n, 1, -1}] // Flatten (* _Jean-François Alcover_, Jan 17 2013 *)
%o A209293 (Python)
%o A209293 t=int((math.sqrt(8*n-7) - 1)/ 2)
%o A209293 i=n-t*(t+1)/2
%o A209293 j=(t*t+3*t+4)/2-n
%o A209293 m1=int((i+j)/2)+int(i/2)*(-1)**(i+t+1)
%o A209293 m2=int((i+j+1)/2)+int(i/2)*(-1)**(i+t)
%o A209293 m=(m1+m2-1)*(m1+m2-2)/2+m1
%Y A209293 Cf. A000217, A000124, A000096, A152948, A034856, A152950, A055998, A000982, A097063.
%K A209293 nonn,tabl
%O A209293 1,2
%A A209293 _Boris Putievskiy_, Jan 16 2013
# Content is available under The OEIS End-User License Agreement: http://oeis.org/LICENSE