cp's OEIS Frontend

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.

A187760 Table T(n,k) read by antidiagonals. T(n,k)=n-k+1, if n>=k, T(n,k)=k-n+2, if n < k.

This page as a plain text file.
%I A187760 #24 Mar 23 2025 23:33:21
%S A187760 1,3,2,4,1,3,5,3,2,4,6,4,1,3,5,7,5,3,2,4,6,8,6,4,1,3,5,7,9,7,5,3,2,4,
%T A187760 6,8,10,8,6,4,1,3,5,7,9,11,9,7,5,3,2,4,6,8,10,12,10,8,6,4,1,3,5,7,9,11
%N A187760 Table T(n,k) read by antidiagonals. T(n,k)=n-k+1, if n>=k, T(n,k)=k-n+2, if n < k.
%C A187760 In general, let m be natural number. T(n,k)=n-k+1, if n>=k, T(n,k)=k-n+m-1, if n <k.  Table T(n,k) read by antidiagonals. The first column of the table T(n,1) is the sequence of the natural numbers A000027. In all columns with number k (k > 1) the segment with the length of (k-1): {m+k-2, m+k-3, ..., m}  shifts the sequence A000027. For m=1 the result is A220073, for m=2 the result is A143182. This sequence is the result for m=3.
%H A187760 Boris Putievskiy, <a href="/A187760/b187760.txt">Rows n = 1..140 of triangle, flattened</a>
%H A187760 Boris Putievskiy, <a href="http://arxiv.org/abs/1212.2732">Transformations Integer Sequences And Pairing Functions</a>, arXiv:1212.2732 [math.CO], 2012.
%F A187760 For the general case, a(n) = |(t+1)^2 - 2n| + m*floor((t^2+3t+2-2n)/(t+1)), where t=floor((-1+sqrt(8*n-7))/2).
%F A187760 For m=3, a(n) = |(t+1)^2 - 2n| + 3*floor((t^2+3t+2-2n)/(t+1)), where t=floor((-1+sqrt(8*n-7))/2).
%e A187760 The start of the sequence as table for the general case:
%e A187760 1....m..m+1..m+2..m+3..m+4..m+5...
%e A187760 2....1....m..m+1..m+2..m+3..m+4...
%e A187760 3....2....1....m..m+1..m+2..m+3...
%e A187760 4....3....2....1....m..m+1..m+2...
%e A187760 5....4....3....2....1....m..m+1...
%e A187760 6....5....4....3....2....1....m...
%e A187760 7....6....5....4....3....2....1...
%e A187760 . . .
%e A187760 The start of the sequence as triangle array read by rows for the general case:
%e A187760 1;
%e A187760 m,2;
%e A187760 m+1,1,3;
%e A187760 m+2,m,2,4;
%e A187760 m+3,m+1,1,3,5;
%e A187760 m+4,m+2,m,2,4,6;
%e A187760 m+5,m+3,m+1,1,3,5,7;
%e A187760 . . .
%e A187760 Row number r contains r numbers: m+r-2, m+r-4,...r-2,r.
%t A187760 T[n_, k_] := If[1 <= k <= n, n - k + 1, k - n + 2];
%t A187760 Table[T[n - k + 1, k], {n, 1, 11}, {k, n, 1, -1}] // Flatten (* _Jean-François Alcover_, Nov 06 2018 *)
%o A187760 (Python)
%o A187760 t=int((math.sqrt(8*n-7)-1)/2)
%o A187760 result=abs((t+1)**2 - 2*n) + 3*int((t**2+3*t+2-2*n)/(t+1))
%Y A187760 Cf. A000027, A220073, A143182.
%K A187760 nonn,tabl
%O A187760 1,2
%A A187760 _Boris Putievskiy_, Jan 04 2013