login
Table T(n,k) = 2*n + ((-1)^n)*(1/2 - (k-1) mod 2) - 1/2; n, k > 0, read by antidiagonals.
1

%I #17 Nov 29 2023 08:49:01

%S 1,2,4,1,3,5,2,4,6,8,1,3,5,7,9,2,4,6,8,10,12,1,3,5,7,9,11,13,2,4,6,8,

%T 10,12,14,16,1,3,5,7,9,11,13,15,17,2,4,6,8,10,12,14,16,18,20,1,3,5,7,

%U 9,11,13,15,17,19,21,2,4,6,8,10,12,14,16,18,20,22

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

%C In general, let B and C be sequences. By b(n) and c(n) denote elements B and C respectively. Table T(n,k) = (1-(-1)^k)*b(n)/2+(1+(-1)^k)*c(n)/2 read by antidiagonals.

%C For this sequence b(n)=2*n-1, b(n)=A005408(n), c(n)=2*n, c(n)=A005843(n).

%C If n is odd row T(n,k) is alternation b(n) and c(n) starts from b(n).

%C If n is even row T(n,k) is alternation c(n) and b(n) starts from c(n).

%C For this sequence if n is odd alternation numbers 2*n-1 and 2*n starts from 2*n-1.

%C For this sequence if n is even alternation numbers 2*n and 2*n-1 starts from 2*n.

%C T(n,k) is replication of the first and the second columns that are “a braid” from sequences B and C.

%H Boris Putievskiy, <a href="/A211197/b211197.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.

%F For the general case:

%F As table T(n,k) = (1-(-1)^k)*b(n)/2+(1+(-1)^k)*c(n)/2.

%F As linear sequence

%F a(n) = (1-(-1)^j)*b(i)/2+(1+(-1)^j)*c(i)/2, where i = n-t*(t+1)/2, j = (t*t+3*t+4)/2-n, t = floor((-1+sqrt(8*n-7))/2).

%F For b(n) = 2*n-1 and c(n) = 2*n:

%F As table T(n,k) = 2*n+((-1)^n)*(1/2- (k-1) mod 2) - 1/2.

%F As linear sequence

%F a(n) = 2*A002260(n) + ((-1)^A002260(n))*(1/2- (A004736(n)-1) mod 2) -1/2.

%F a(n) = -(1+(-1)^A003056(n))*A002260(n) +(1+(-1)^A003056(n))*(2*A002260(n)-1)/2.

%F a(n) = 2*i+((-1)^i)*(1/2- (j-1) mod 2) - 1/2, a(n) = -(1+(-1)^t)*i +(1+(-1)^t)*(2*i-1)/2, 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 for general case:

%e b(1)..c(1)..b(1)..c(1)..b(1)..c(1)..b(1)..c(1)..

%e c(2)..b(2)..c(2)..b(2)..c(2)..b(2)..c(2)..b(2)..

%e b(3)..c(3)..b(3)..c(3)..b(3)..c(3)..b(3)..c(3)..

%e c(4)..b(4)..c(4)..b(4)..c(4)..b(4)..c(4)..b(4)..

%e b(5)..c(5)..b(5)..c(5)..b(5)..c(5)..b(5)..c(5)..

%e c(6)..b(6)..c(6)..b(6)..c(6)..b(6)..c(6)..b(6)..

%e b(7)..c(7)..b(7)..c(7)..b(7)..c(7)..b(7)..c(7)..

%e c(8)..b(8)..c(8)..b(8)..c(8)..b(8)..c(8)..b(8)..

%e . . .

%e The start of the sequence as triangle array read by rows for general case:

%e b(1);

%e c(1),c(2);

%e b(1),b(2),b(3);

%e c(1),c(2),c(3),c(4);

%e b(1),b(2),b(3),b(4),b(5);

%e c(1),c(2),c(3),c(4),c(5),c(6);

%e b(1),b(2),b(3),b(4),b(5),b(6),b(7);

%e c(1),c(2),c(3),c(4),c(5),c(6),c(7),c(8);

%e . . .

%e Row number r contains r numbers.

%e If r is odd b(1),b(2),...,b(r).

%e If r is even c(1),c(2),...,c(r).

%e The start of the sequence as table for b(n)=2*n-1 and c(n)=2*n:

%e 1....2...1...2...1...2...1...2...

%e 4....3...4...3...4...3...4...3...

%e 5....6...5...6...5...6...5...6...

%e 8....7...8...7...8...7...8...7...

%e 9...10...9..10...9..10...9..10...

%e 12..11..12..11..12..11..12..11...

%e 13..14..13..14..13..14..13..14...

%e 16..15..16..15..16..15..16..15...

%e . . .

%e The start of the sequence as triangle array read by rows for b(n)=2*n-1 and c(n)=2*n:

%e 1;

%e 2,4;

%e 1,3,5;

%e 2,4,6,8;

%e 1,3,5,7,9;

%e 2,4,6,8,10,12;

%e 1,3,5,7,9,11,13;

%e 2,4,6,8,10,12,14,16;

%e . . .

%e Row number r contains r numbers.

%e If r is odd 1,3,...2*r-1 - coincides with the elements row number r triangle array read by rows for sequence 2*A002260-1.

%e If r is even 2,4,...,2*r - coincides with the elements row number r triangle array read by rows for sequence 2*A002260.

%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 =2*i+((-1)**i)*(0.5 - (j-1) % 2) - 0.5

%Y Cf. A000027, A003056, A002260, A004736, A210530, A158405, A005408, A005843.

%K nonn,tabl

%O 1,2

%A _Boris Putievskiy_, Feb 03 2013