The OEIS mourns the passing of Jim Simons and is grateful to the Simons Foundation for its support of research in many branches of science, including the OEIS.
login
The OEIS is supported by the many generous donors to the OEIS Foundation.

 

Logo
Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A216250 T(n,k) = ((n+k)^2-4*k+3-2*(-1)^n-(-1)^k-(n+k-4)*(-1)^(n+k))/2-3, if k=1 and (n mod 2)=1; T(n,k) = ((n+k)^2-4*k+3-2*(-1)^n-(-1)^k-(n+k-4)*(-1)^(n+k))/2, else. Table T(n,k) read by antidiagonals; n, k > 0. 1

%I #20 Nov 29 2023 08:15:00

%S 1,2,3,5,4,6,7,8,11,12,10,9,14,13,15,16,17,20,21,24,25,19,18,23,22,27,

%T 26,28,29,30,33,34,37,38,41,42,32,31,36,35,40,39,44,43,45,46,47,50,51,

%U 54,55,58,59,62,63,49,48,53,52,57,56,61,60,65,64,66,67

%N T(n,k) = ((n+k)^2-4*k+3-2*(-1)^n-(-1)^k-(n+k-4)*(-1)^(n+k))/2-3, if k=1 and (n mod 2)=1; T(n,k) = ((n+k)^2-4*k+3-2*(-1)^n-(-1)^k-(n+k-4)*(-1)^(n+k))/2, else. Table T(n,k) read by antidiagonals; n, k > 0.

%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(1,2), T(2,1), T(2,2), T(1,3), T(3,1);

%C . . .

%C T(1,2*m), T(2,2*m-1), T(2,2*m), T(1,2*m+1), T(3,2*m-2), ... T(2*m-1,2), T(2*m,1), T(2*m,2), T(2*m-1,3), T(2*m+1,1);

%C . . .

%C Movement along two adjacent antidiagonals - step to the southwest, step east, step to the northeast, 3 steps to the west, 2 steps to the south and so on. The length of each step is 1.

%H Boris Putievskiy, <a href="/A216250/b216250.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-4*k+3-2*(-1)^n-(-1)^k-(n+k-4)*(-1)^(n+k))/2-3, if k=1 and (n mod 2)=1;

%F T(n,k) = ((n+k)^2-4*k+3-2*(-1)^n-(-1)^k-(n+k-4)*(-1)^(n+k))/2, else.

%F As linear sequence

%F a(n) = ((t+2)^2-4*j+3-2*(-1)^i-(-1)^j-(t-2)*(-1)^t)/2-3, if j=1 and (i mod 2)=1;

%F a(n) = ((t+2)^2-4*j+3-2*(-1)^i-(-1)^j-(t-2)*(-1)^t)/2, else; 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....2...5...7..10..16..19...

%e 3....4...8...9..17..18..30...

%e 6...11..14..20..23..33..36...

%e 12..13..21..22..34..35..51...

%e 15..24..27..37..40..54..57...

%e 25..26..38..39..55..56..76...

%e 28..41..44..58..61..79..82...

%e . . .

%e The start of the sequence as triangular array read by rows:

%e 1;

%e 2,3;

%e 5,4,6;

%e 7,8,11,12;

%e 10,9,14,13,15;

%e 16,17,20,21,24,25;

%e 19,18,23,22,27,26,28;

%e . . .

%e The start of the sequence as array read by rows, with length of row r: 4*r-3:

%e First 2*r-2 numbers are from the row number 2*r-2 of above triangle array.

%e Last 2*r-1 numbers are from the row number 2*r-1 of above triangle array.

%e 1;

%e 2,3,5,4,6;

%e 7,8,11,12,10,9,14,13,15;

%e 16,17,20,21,24,25,19,18,23,22,27,26,28;

%e . . .

%e Row number r contains permutation of the 4*r-3 numbers from 2*r*r-5*r+4 to 2*r*r-r: 2*r*r-5*r+4, 2*r*r-5*r+5, ...2*r*r-r-2, 2*r*r-r.

%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-4*j+3-(-1)**j-2*(-1)**i-(t-2)*(-1)**t)/2

%o if j==1 and (i%2)==1:

%o result=result-3

%Y Cf. A213205, A213171, A213197, A210521; table T(n,k) contains: in rows A130883, A033816, A100037, A100038, A100039; in columns A000384, A014106, A071355, A091823, A130861.

%K nonn,tabl

%O 1,2

%A _Boris Putievskiy_, Mar 14 2013

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recents
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified May 23 06:30 EDT 2024. Contains 372760 sequences. (Running on oeis4.)