login
A172090
Triangle T(n, k) = f(n-k) + f(k) - f(n), where f(n) = -3*n with f(0) = 1, f(1) = -2, read by rows.
1
1, 1, 1, 1, 2, 1, 1, 1, 1, 1, 1, 1, 0, 1, 1, 1, 1, 0, 0, 1, 1, 1, 1, 0, 0, 0, 1, 1, 1, 1, 0, 0, 0, 0, 1, 1, 1, 1, 0, 0, 0, 0, 0, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1
OFFSET
0,5
FORMULA
T(n, k) = f(n-k) + f(k) - f(n), where f(n) = -3*n with f(0) = 1, f(1) = -2.
From G. C. Greubel, Apr 29 2021: (Start)
T(n, k) is defined by T(n, 0) = T(n, 1) = T(n, n-1) = T(n, n) = T(3, k) = 1, T(2, 1) = 2 and 0 otherwise.
Sum_{k=0..n} T(n,k) = A151798(n). (End)
EXAMPLE
Triangle begins as:
1;
1, 1;
1, 2, 1;
1, 1, 1, 1;
1, 1, 0, 1, 1;
1, 1, 0, 0, 1, 1;
1, 1, 0, 0, 0, 1, 1;
1, 1, 0, 0, 0, 0, 1, 1;
1, 1, 0, 0, 0, 0, 0, 1, 1;
1, 1, 0, 0, 0, 0, 0, 0, 1, 1;
1, 1, 0, 0, 0, 0, 0, 0, 0, 1, 1;
MATHEMATICA
(* First program *)
f[n_]:= f[n]= If[n < 2, (-1)^n*(n+1), -3*n];
T[n_, k_]:= f[n-k] +f[k] -f[n];
Table[T[n, k], {n, 0, 15}, {k, 0, n}]//Flatten (* modified by G. C. Greubel, Apr 29 2021 *)
(* Second program *)
T[n_, k_]:= If[n<3, Binomial[n, k], If[n==3 || k<2 || k>n-2, 1, 0]];
Table[T[n, k], {n, 0, 15}, {k, 0, n}]//Flatten (* G. C. Greubel, Apr 29 2021 *)
PROG
(Sage)
def f(n): return (-1)^n*(n+1) if (n<2) else -3*n
def T(n, k): return f(n-k) + f(k) - f(n)
flatten([[T(n, k) for k in (0..n)] for n in (0..15)]) # G. C. Greubel, Apr 29 2021
CROSSREFS
Row sums are A151798.
Sequence in context: A316863 A037911 A176046 * A037912 A056980 A268643
KEYWORD
nonn,tabl,easy,less
AUTHOR
Roger L. Bagula, Jan 25 2010
EXTENSIONS
Edited by G. C. Greubel, Apr 29 2021
STATUS
approved