login
Triangle T(n,m) = 1 + m*(m-n) read by rows, 0 <= m <= n.
2

%I #37 Sep 08 2022 08:45:52

%S 1,1,1,1,0,1,1,-1,-1,1,1,-2,-3,-2,1,1,-3,-5,-5,-3,1,1,-4,-7,-8,-7,-4,

%T 1,1,-5,-9,-11,-11,-9,-5,1,1,-6,-11,-14,-15,-14,-11,-6,1,1,-7,-13,-17,

%U -19,-19,-17,-13,-7,1,1,-8,-15,-20,-23,-24,-23,-20,-15,-8,1

%N Triangle T(n,m) = 1 + m*(m-n) read by rows, 0 <= m <= n.

%C For GCD(-1 - m,-1 - n + m) = 1, smallest number that cannot be written as a*(-1 - m) + b*(-1 - n + m) with a and b in the nonnegative integers. - _Thomas Anton_, May 22 2019

%H G. C. Greubel, <a href="/A176270/b176270.txt">Rows n = 0..100 of triangle, flattened</a>

%F T(n,m) = binomial(n-m+1,2) + binomial(m+1,2) - binomial(n+1,2) + 1 = m^2 - n*m + 1.

%F T(n,m) = T(n,n-m).

%F T(n,m) = 2 - A077028(n,m) for 0 <= m <= n. - _Werner Schulte_, Nov 10 2020

%e Triangle begins

%e 1;

%e 1, 1;

%e 1, 0, 1;

%e 1, -1, -1, 1;

%e 1, -2, -3, -2, 1;

%e 1, -3, -5, -5, -3, 1;

%e 1, -4, -7, -8, -7, -4, 1;

%e 1, -5, -9, -11, -11, -9, -5, 1;

%e 1, -6, -11, -14, -15, -14, -11, -6, 1;

%e 1, -7, -13, -17, -19, -19, -17, -13, -7, 1;

%e 1, -8, -15, -20, -23, -24, -23, -20, -15, -8, 1;

%p A176270 := proc(n,m)

%p 1+m*(m-n) ;

%p end proc: # _R. J. Mathar_, May 03 2013

%t Table[k*(k-n)+1, {n,0,12}, {k,0,n}]//Flatten (* modified by _G. C. Greubel_, May 30 2019 *)

%o (PARI) {T(n,k) = k*(k-n)+1}; \\ _G. C. Greubel_, May 30 2019

%o (Magma) [[k*(k-n)+1: k in [0..n]]: n in [0..12]]; // _G. C. Greubel_, May 30 2019

%o (Sage) [[k*(k-n)+1 for k in (0..n)] for n in (0..12)] # _G. C. Greubel_, May 30 2019

%o (GAP) Flat(List([0..12], n-> List([0..n], k-> k*(k-n)+1 ))); # _G. C. Greubel_, May 30 2019

%Y Cf. A005586 (row sums), A077028.

%K sign,tabl,easy

%O 0,12

%A _Roger L. Bagula_, Apr 13 2010

%E Edited by _R. J. Mathar_, May 03 2013