[go: up one dir, main page]

login
Table T(n,k) = n, if k is odd, k/2 if k is even; n, k > 0, read by antidiagonals.
2

%I #21 May 21 2021 15:59:51

%S 1,1,2,1,1,3,2,2,1,4,1,2,3,1,5,3,2,2,4,1,6,1,3,3,2,5,1,7,4,2,3,4,2,6,

%T 1,8,1,4,3,3,5,2,7,1,9,5,2,4,4,3,6,2,8,1,10,1,5,3,4,5,3,7,2,9,1,11,6,

%U 2,5,4,4,6,3,8,2,10,1,12,1,6,3,5,5,4,7,3

%N Table T(n,k) = n, if k is odd, k/2 if k is even; 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) = b(n), if k is odd, c(k) if k is even. For this sequence b(n)=n, c(k)=k.

%C Row T(n,k) is b(n),c(1),b(n),c(2),b(n),c(3),...Numbers c(1),c(2),c(3),... sandwiched between b(n)'s. For this sequence numbers 1,2,3,... (A000027) sandwiched between n's.

%H Boris Putievskiy, <a href="/A211161/b211161.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)*c(k/2)/2 - (-1+(-1)^k)*b(n)/2.

%F As linear sequence

%F a(n) = (1+(-1)^j)*c(j/2)/2 - (-1+(-1)^j)*b(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) = n and c(k) = k:

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

%F As linear sequence a(n) = (1+(-1)^A004736(n))*A004736(n)/4 - (-1+(-1)^A004736(n))*A002260(n)/2. a(n) = (1+(-1)^j)*j/4 - (-1+(-1)^j)*i/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 for general case:

%e b(1)..c(1)..b(1)..c(2)..b(1)..c(3)..b(1)..c(4)...

%e b(2)..c(1)..b(2)..c(2)..b(2)..c(3)..b(2)..c(4)...

%e b(3)..c(1)..b(3)..c(2)..b(3)..c(3)..b(3)..c(4)...

%e b(4)..c(1)..b(4)..c(2)..b(4)..c(3)..b(4)..c(4)...

%e b(5)..c(1)..b(5)..c(2)..b(5)..c(3)..b(5)..c(4)...

%e b(6)..c(1)..b(6)..c(2)..b(6)..c(3)..b(6)..c(4)...

%e b(7)..c(1)..b(7)..c(2)..b(7)..c(3)..b(7)..c(4)...

%e b(8)..c(1)..b(8)..c(2)..b(8)..c(3)..b(8)..c(4)...

%e . . .

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

%e b(1);

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

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

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

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

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

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

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

%e . . .

%e Row number r contains r numbers.

%e If r is odd b(1),c((r-1)/2),b(3),c((r-1)/2-1),b(5),c((r-1)/2-2),...c(1),b(r).

%e If r is even c(r/2),b(2),c(r/2-1),b(4),c(r/2-2),b(6),...c(1),b(r).

%e The start of the sequence as table for b(n)=n and c(k)=k:

%e 1..1..1..2..1..3..1..4...

%e 2..1..2..2..2..3..2..4...

%e 3..1..3..2..3..3..3..4...

%e 4..1..4..2..4..3..4..4...

%e 5..1..5..2..5..3..5..4...

%e 6..1..6..2..6..3..6..4...

%e 7..1..7..2..7..3..7..4...

%e 8..1..8..2..8..3..8..4...

%e . . .

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

%e 1;

%e 1,2;

%e 1,1,3;

%e 2,2,1,4;

%e 1,2,3,1,5;

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

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

%e 4,2,3,4,2,6,1,8;

%e . . .

%e Row number r contains r numbers.

%e If r is odd 1,(r-1)/2,3,(r-1)/2-1,5,(r-1)/2-2,...1,r.

%e If r id even r/2,2,r/2-1,4,r/2-1,6,...1,r.

%o (Python)

%o def a(n):

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

%Y Cf. A000027, A002260, A004736, A210530.

%K nonn,tabl

%O 1,3

%A _Boris Putievskiy_, Jan 30 2013