login
A143187
Triangle read by rows: T(n, k) = f(k) for 1 <= k <= floor(n/2), T(n, k) = f(n-k) for floor(n/2) < k <= n-1, with T(n, 0) = 1, T(n, n) = 1, and f(k) = (1/2)*(3 - (-1)^k)*k.
2
1, 1, 1, 1, 2, 1, 1, 2, 2, 1, 1, 2, 2, 2, 1, 1, 2, 2, 2, 2, 1, 1, 2, 2, 6, 2, 2, 1, 1, 2, 2, 6, 6, 2, 2, 1, 1, 2, 2, 6, 4, 6, 2, 2, 1, 1, 2, 2, 6, 4, 4, 6, 2, 2, 1, 1, 2, 2, 6, 4, 10, 4, 6, 2, 2, 1, 1, 2, 2, 6, 4, 10, 10, 4, 6, 2, 2, 1, 1, 2, 2, 6, 4, 10, 6, 10, 4, 6, 2, 2, 1
OFFSET
0,5
FORMULA
T(n, k) = f(k) for 1 <= k <= floor(n/2), T(n, k) = f(n-k) for floor(n/2) < k <= n-1, with T(n, 0) = 1, T(n, n) = 1, and f(k) = (1/2)*(3 - (-1)^k)*k.
T(n, n-k) = T(n, k).
Sum_{k=0..n} T(n, k) = (1/16)*(33 + 3*(-1)^n - 4*cos(n*Pi/2) - 4*sin(n*Pi/2)*n + 6*n^2) - [n=0] (row sums). - G. C. Greubel, Apr 30 2024
EXAMPLE
Triangle begins as:
1;
1, 1;
1, 2, 1;
1, 2, 2, 1;
1, 2, 2, 2, 1;
1, 2, 2, 2, 2, 1;
1, 2, 2, 6, 2, 2, 1;
1, 2, 2, 6, 6, 2, 2, 1;
1, 2, 2, 6, 4, 6, 2, 2, 1;
1, 2, 2, 6, 4, 4, 6, 2, 2, 1;
1, 2, 2, 6, 4, 10, 4, 6, 2, 2, 1;
MATHEMATICA
f[n_]= (3-(-1)^n)*n/2;
T[n_, k_]:= If[k*(n-k)==0, 1, If[k <= Floor[n/2], f[k], f[n-k]]];
Table[T[n, k], {n, 0, 12}, {k, 0, n}]//Flatten
PROG
(Magma)
f:= func< n | (3-(-1)^n)*n/2 >;
A143187:= func< n, k | k eq 0 or k eq n select 1 else k le Floor(n/2) select f(k) else f(n-k) >;
[A143187(n, k): k in [0..n], n in [0..13]]; // G. C. Greubel, Apr 30 2024
(SageMath)
def f(n): return (3-(-1)^n)*n/2
def A143187(n, k):
if k==0 or k==n: return 1
elif k<=n//2: return f(k)
else: return f(n-k)
flatten([[A143187(n, k) for k in range(n+1)] for n in range(14)]) # G. C. Greubel, Apr 30 2024
CROSSREFS
Cf. A143188.
Sequence in context: A157415 A154325 A129765 * A348042 A143209 A163994
KEYWORD
nonn,tabl
AUTHOR
EXTENSIONS
Edited by G. C. Greubel, Apr 30 2024
STATUS
approved