A211197 Table T(n,k) = 2*n + ((-1)^n)*(1/2 - (k-1) mod 2) - 1/2; n, k > 0, read by antidiagonals.
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, 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, 9, 11, 13, 15, 17, 19, 21, 2, 4, 6, 8, 10, 12, 14, 16, 18, 20, 22
Offset: 1
Examples
The start of the sequence as table for general case: b(1)..c(1)..b(1)..c(1)..b(1)..c(1)..b(1)..c(1).. c(2)..b(2)..c(2)..b(2)..c(2)..b(2)..c(2)..b(2).. b(3)..c(3)..b(3)..c(3)..b(3)..c(3)..b(3)..c(3).. c(4)..b(4)..c(4)..b(4)..c(4)..b(4)..c(4)..b(4).. b(5)..c(5)..b(5)..c(5)..b(5)..c(5)..b(5)..c(5).. c(6)..b(6)..c(6)..b(6)..c(6)..b(6)..c(6)..b(6).. b(7)..c(7)..b(7)..c(7)..b(7)..c(7)..b(7)..c(7).. c(8)..b(8)..c(8)..b(8)..c(8)..b(8)..c(8)..b(8).. . . . The start of the sequence as triangle array read by rows for general case: b(1); c(1),c(2); b(1),b(2),b(3); c(1),c(2),c(3),c(4); b(1),b(2),b(3),b(4),b(5); c(1),c(2),c(3),c(4),c(5),c(6); b(1),b(2),b(3),b(4),b(5),b(6),b(7); c(1),c(2),c(3),c(4),c(5),c(6),c(7),c(8); . . . Row number r contains r numbers. If r is odd b(1),b(2),...,b(r). If r is even c(1),c(2),...,c(r). The start of the sequence as table for b(n)=2*n-1 and c(n)=2*n: 1....2...1...2...1...2...1...2... 4....3...4...3...4...3...4...3... 5....6...5...6...5...6...5...6... 8....7...8...7...8...7...8...7... 9...10...9..10...9..10...9..10... 12..11..12..11..12..11..12..11... 13..14..13..14..13..14..13..14... 16..15..16..15..16..15..16..15... . . . The start of the sequence as triangle array read by rows for b(n)=2*n-1 and c(n)=2*n: 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,10,12,14,16; . . . Row number r contains r numbers. 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. If r is even 2,4,...,2*r - coincides with the elements row number r triangle array read by rows for sequence 2*A002260.
Links
- Boris Putievskiy, Rows n = 1..140 of triangle, flattened
- Boris Putievskiy, Transformations [of] Integer Sequences And Pairing Functions, arXiv:1212.2732 [math.CO], 2012.
Programs
-
Python
t=int((math.sqrt(8*n-7) - 1)/ 2) i=n-t*(t+1)/2 j=(t*t+3*t+4)/2-n result =2*i+((-1)**i)*(0.5 - (j-1) % 2) - 0.5
-
Python
a211197_list = [2*n - k%2 for k in range(1, 13) for n in range(1, k+1)] # David Radcliffe, Jun 01 2025
Formula
For the general case:
As a table: T(n,k) = (1-(-1)^k)*b(n)/2+(1+(-1)^k)*c(n)/2.
As a linear sequence: 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).
where b(n) = 2*n-1 and c(n) = 2*n.
As a table: T(n,k) = 2*n+((-1)^n)*(1/2- (k-1) mod 2) - 1/2.
As a linear sequence:
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).
Comments