login
A143199
Triangle read by rows: T(n, k) = (n+1)*A000096(k-1) + n if k <= floor(n/2), otherwise T(n, k) = (n+1)*A000096(n-k-1) + n.
1
-1, -1, -1, -1, 2, -1, -1, 3, 3, -1, -1, 4, 14, 4, -1, -1, 5, 17, 17, 5, -1, -1, 6, 20, 41, 20, 6, -1, -1, 7, 23, 47, 47, 23, 7, -1, -1, 8, 26, 53, 89, 53, 26, 8, -1, -1, 9, 29, 59, 99, 99, 59, 29, 9, -1, -1, 10, 32, 65, 109, 164, 109, 65, 32, 10, -1
OFFSET
0,5
FORMULA
T(n, m) = (n + 1)*(if m <= floor(n/2) then (m - 1)*(m + 2) / 2 else (n - m + 2)*(n - (m + 1)) / 2 fi) + n. - Georg Fischer, Oct 28 2023
From G. C. Greubel, Jun 10 2024: (Start)
T(n, k) = n + (n+1)*(k-1)*(k+2)/2 if 0 <= k <= floor(n/2), otherwise T(n, k) = T(n, n-k).
Sum_{k=0..n} T(n, k) = (1/48)*(n+1)*(-53 - 5*n + 3*(-1)^n*(n+1) + 2*(n + 1)^3). (End)
EXAMPLE
Triangle begins as:
-1;
-1, -1;
-1, 2, -1;
-1, 3, 3, -1;
-1, 4, 14, 4, -1;
-1, 5, 17, 17, 5, -1;
-1, 6, 20, 41, 20, 6, -1;
-1, 7, 23, 47, 47, 23, 7, -1;
-1, 8, 26, 53, 89, 53, 26, 8, -1;
-1, 9, 29, 59, 99, 99, 59, 29, 9, -1;
-1, 10, 32, 65, 109, 164, 109, 65, 32, 10, -1;
MAPLE
seq(print(seq((n + 1) * (if m <= n/2 then (m - 1) * (m + 2)\
/ 2 else (n - m + 2) * (n - (m + 1)) / 2 fi) + n, m=0..n)), n=0..10); # Georg Fischer, Oct 28 2023
MATHEMATICA
T[n_, k_]:= If[k<=Floor[n/2], n +(n+1)*(k-1)*(k+2)/2, T[n, n-k]];
Table[T[n, k], {n, 0, 12}, {k, 0, n}]//Flatten
PROG
(Magma)
function T(n, k) // A143199
if k le Floor(n/2) then return n + (n+1)*(k-1)*(k+2)/2;
else return T(n, n-k);
end if;
end function;
[T(n, k): k in [0..n], n in [0..12]]; // G. C. Greubel, Jun 10 2024
(SageMath)
def A143199(n, k): return n +(n+1)*(k-1)*(k+2)//2 if (k<1+int(n//2)) else A143199(n, n-k)
flatten([[A143199(n, k) for k in range(n+1)] for n in range(13)]) # G. C. Greubel, Jun 10 2024
CROSSREFS
KEYWORD
sign,tabl
AUTHOR
EXTENSIONS
Definition clarified and offset corrected by Georg Fischer, Oct 28 2023
STATUS
approved