OFFSET
0,8
LINKS
G. C. Greubel, Rows n = 0..50 of the triangle, flattened
FORMULA
T(n, k) = f(n, k) + f(n, n-k) - 1, where f(n, k) = k if k <= floor(n/4), floor(n/2) - k if floor(n/4) < k <= floor(n/2), k - floor(n/2) if floor(n/2) < k <= floor(3*n/4), otherwise n-k.
From G. C. Greubel, Jan 22 2022: (Start)
T(n, n-k) = T(n, k).
T(2*n, n) = 1.
T(2*n+1, n) = A040000(n).
Sum_{k=0..n} T(n, k) = A302488(n). (End)
EXAMPLE
Triangle begins as:
1;
1, 1;
1, 1, 1;
1, 2, 2, 1;
1, 3, 1, 3, 1;
1, 3, 2, 2, 3, 1;
1, 3, 3, 1, 3, 3, 1;
1, 3, 4, 2, 2, 4, 3, 1;
1, 3, 5, 3, 1, 3, 5, 3, 1;
1, 3, 5, 4, 2, 2, 4, 5, 3, 1;
1, 3, 5, 5, 3, 1, 3, 5, 5, 3, 1;
MATHEMATICA
f[n_, k_]= 1 +If[k<=Floor[n/4], k, If[Floor[n/4]<k<=Floor[n/2], Floor[n/2]-k, If[Floor[n/2]<k<=Floor[3*n/4], k-Floor[n/2], n-k]]];
T[n_, k_]:= f[n, k] +f[n, n-k] -1;
Table[T[n, k], {n, 0, 15}, {k, 0, n}]//Flatten (* modified by G. C. Greubel, Jan 22 2022 *)
PROG
(Sage)
def f(n, k):
if (k <= (n//4)): return k+1
elif ((n//4) < k <= (n//2)): return (n//2)-k+1
elif ((n//2) < k <= (3*n//4)): return k+1-(n//2)
else: return n-k+1
def T(n, k): return f(n, k) + f(n, n-k) - 1
flatten([[T(n, k) for k in (0..n)] for n in (0..15)]) # G. C. Greubel, Jan 22 2022
CROSSREFS
KEYWORD
nonn,tabl
AUTHOR
Roger L. Bagula, Mar 02 2009
EXTENSIONS
Edited by N. J. A. Sloane, Mar 05 2009
STATUS
approved