This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.
%I A211161 #21 May 21 2021 15:59:51 %S A211161 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 A211161 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 A211161 2,5,4,4,6,3,8,2,10,1,12,1,6,3,5,5,4,7,3 %N A211161 Table T(n,k) = n, if k is odd, k/2 if k is even; n, k > 0, read by antidiagonals. %C A211161 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 A211161 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 A211161 Boris Putievskiy, <a href="/A211161/b211161.txt">Rows n = 1..140 of triangle, flattened</a> %H A211161 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 A211161 For the general case %F A211161 As table T(n,k) = (1+(-1)^k)*c(k/2)/2 - (-1+(-1)^k)*b(n)/2. %F A211161 As linear sequence %F A211161 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 A211161 For b(n) = n and c(k) = k: %F A211161 As table T(n,k) = (1+(-1)^k)*k/4 - (-1+(-1)^k)*n/2. %F A211161 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 A211161 where i = n-t*(t+1)/2, j = (t*t+3*t+4)/2-n, t = floor((-1+sqrt(8*n-7))/2). %e A211161 The start of the sequence as table for general case: %e A211161 b(1)..c(1)..b(1)..c(2)..b(1)..c(3)..b(1)..c(4)... %e A211161 b(2)..c(1)..b(2)..c(2)..b(2)..c(3)..b(2)..c(4)... %e A211161 b(3)..c(1)..b(3)..c(2)..b(3)..c(3)..b(3)..c(4)... %e A211161 b(4)..c(1)..b(4)..c(2)..b(4)..c(3)..b(4)..c(4)... %e A211161 b(5)..c(1)..b(5)..c(2)..b(5)..c(3)..b(5)..c(4)... %e A211161 b(6)..c(1)..b(6)..c(2)..b(6)..c(3)..b(6)..c(4)... %e A211161 b(7)..c(1)..b(7)..c(2)..b(7)..c(3)..b(7)..c(4)... %e A211161 b(8)..c(1)..b(8)..c(2)..b(8)..c(3)..b(8)..c(4)... %e A211161 . . . %e A211161 The start of the sequence as triangle array read by rows for general case: %e A211161 b(1); %e A211161 c(1),b(2); %e A211161 b(1),c(1),b(3); %e A211161 c(2),b(2),c(1),b(4); %e A211161 b(1),c(2),b(3),c(1),b(5); %e A211161 c(3),b(2),c(2),b(4),c(1),b(6); %e A211161 b(1),c(3),b(3),c(2),b(5),c(1),b(7); %e A211161 c(4),b(2),c(3),b(4),c(2),b(6),c(1),b(8); %e A211161 . . . %e A211161 Row number r contains r numbers. %e A211161 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 A211161 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 A211161 The start of the sequence as table for b(n)=n and c(k)=k: %e A211161 1..1..1..2..1..3..1..4... %e A211161 2..1..2..2..2..3..2..4... %e A211161 3..1..3..2..3..3..3..4... %e A211161 4..1..4..2..4..3..4..4... %e A211161 5..1..5..2..5..3..5..4... %e A211161 6..1..6..2..6..3..6..4... %e A211161 7..1..7..2..7..3..7..4... %e A211161 8..1..8..2..8..3..8..4... %e A211161 . . . %e A211161 The start of the sequence as triangle array read by rows for b(n)=n and c(k)=k: %e A211161 1; %e A211161 1,2; %e A211161 1,1,3; %e A211161 2,2,1,4; %e A211161 1,2,3,1,5; %e A211161 3,2,2,4,1,6; %e A211161 1,3,3,2,5,1,7; %e A211161 4,2,3,4,2,6,1,8; %e A211161 . . . %e A211161 Row number r contains r numbers. %e A211161 If r is odd 1,(r-1)/2,3,(r-1)/2-1,5,(r-1)/2-2,...1,r. %e A211161 If r id even r/2,2,r/2-1,4,r/2-1,6,...1,r. %o A211161 (Python) %o A211161 def a(n): %o A211161 t=int((math.sqrt(8*n-7) - 1)/ 2) %o A211161 i=n-t*(t+1)//2 %o A211161 j=(t*t+3*t+4)//2-n %o A211161 return (1+(-1)**j)*j//4 - (-1+(-1)**j)*i//2 %Y A211161 Cf. A000027, A002260, A004736, A210530. %K A211161 nonn,tabl %O A211161 1,3 %A A211161 _Boris Putievskiy_, Jan 30 2013