OFFSET
1,2
LINKS
G. C. Greubel, Rows n = 1..100 of triangle, flattened
John Baez, Week 181
FORMULA
T(n, k) = k*(k+1)/2 + 2*k*(n-k) if 0 < k <= n.
G.f.: (1+x-2*x^2*y)/((1-x)^2*(1-x*y)^3). - Vladeta Jovovic, Mar 05 2004
T(n, k) = A141419(2*n-k, k). - Peter Munn, Aug 21 2019
EXAMPLE
Rows:
1;
3, 3;
5, 7, 6;
7, 11, 12, 10;
9, 15, 18, 18, 15;
11, 19, 24, 26, 25, 21;
...
MAPLE
T:=(n, k) -> k*(k+1)/2+2*k*(n-k); r:=n->[seq(T(n, k), k=1..n)]; for r from 1 to 12 do lprint(r(n)); od: # N. J. A. Sloane, Aug 21 2019
MATHEMATICA
nmax = 12; t[n_, k_] := If[k < 1 || k > n, 0, k*(k+1)/2 + 2*k*(n-k)]; Flatten[ Table[t[n , k], {n, 1, nmax}, {k, 1, n}]] (* Jean-François Alcover, Oct 19 2011, after PARI *)
PROG
(PARI) {T(n, k) = if( k<1 || k>n, 0, k * (k + 1) / 2 + 2 * k * (n - k))}
(Magma) [k*(k+1 + 4*(n-k))/2: k in [1..n], n in [1..12]]; // G. C. Greubel, Sep 05 2019
(Sage) [[k*(k+1 + 4*(n-k))/2 for k in (1..n)] for n in (1..12)] # G. C. Greubel, Sep 05 2019
(GAP) Flat(List([1..12], n-> List([1..n], k-> k*(k+1 + 4*(n-k))/2 ))); # G. C. Greubel, Sep 05 2019
CROSSREFS
KEYWORD
AUTHOR
Michael Somos, Apr 28 2002
EXTENSIONS
Offset changed to 1 by N. J. A. Sloane, Aug 21 2019
STATUS
approved