OFFSET
1,4
COMMENTS
T(n,k) = number of 2-element subsets of {1,2,...,n+2} such that the absolute difference of the elements is k+1, where 1 <= k < = n. E.g., T(7,3) = 3, the subsets are {1,5}, {2,6}, and {3,7}. - Christian Barrientos, Jun 27 2022
LINKS
G. C. Greubel, Rows n = 1..100 of the triangle, flattened
FORMULA
Sum_{k=1..n} T(n, k) = A002620(n+1) (row sums). - Gary W. Adamson, Oct 25 2007
T(n, k) = [x^k] p(n), where p(n) are partial Gaussian polynomials (A008967) defined by p(n) = Sum_{k=0..n} Sum_{j=0..n-k} even(k)*x^j, and even(k) = 1 if k is even and otherwise 0. We assume offset 0. - Peter Luschny, Jun 03 2021
T(n, k) = floor((n+2-k)/2). - Christian Barrientos, Jun 27 2022
From G. C. Greubel, Mar 14 2024: (Start)
T(n, k) = A128623(n, k)/n.
Sum_{k=1..n} (-1)^(k-1)*T(n, k) = A142150(n+1).
Sum_{k=1..floor((n+1)/2)} T(n-k+1, k) = A008805(n-1).
Sum_{k=1..floor((n+1)/2)} (-1)^(k-1)*T(n-k+1, k) = A002265(n+3). (End)
EXAMPLE
Triangle begins as, for n >= 1, 1 <= k <= n,
1;
1, 1;
2, 1, 1;
2, 2, 1, 1;
3, 2, 2, 1, 1;
3, 3, 2, 2, 1, 1;
4, 3, 3, 2, 2, 1, 1;
...
MAPLE
# Assuming offset 0:
Even := n -> (1 + (-1)^n)/2: # Iverson's even.
p := n -> add(add(Even(k)*x^j, j = 0..n-k), k = 0..n):
for n from 0 to 9 do seq(coeff(p(n), x, k), k=0..n) od; # Peter Luschny, Jun 03 2021
MATHEMATICA
Table[Floor[(n-k+2)/2], {n, 15}, {k, n}]//Flatten (* G. C. Greubel, Mar 14 2024 *)
PROG
(Magma) [Floor((n-k+2)/2): k in [1..n], n in [1..15]]; // G. C. Greubel, Mar 14 2024
(SageMath) flatten([[(n-k+2)//2 for k in range(1, n+1)] for n in range(1, 16)]) # G. C. Greubel, Mar 14 2024
CROSSREFS
KEYWORD
nonn,tabl
AUTHOR
Roger L. Bagula, Mar 07 2006
EXTENSIONS
Edited by N. J. A. Sloane, Mar 23 2008 and Dec 15 2017
STATUS
approved