login
Triangle read by rows: row n consists of n zeros followed by n+1.
40

%I #42 Mar 15 2024 22:26:39

%S 1,0,2,0,0,3,0,0,0,4,0,0,0,0,5,0,0,0,0,0,6,0,0,0,0,0,0,7,0,0,0,0,0,0,

%T 0,8,0,0,0,0,0,0,0,0,9,0,0,0,0,0,0,0,0,0,10,0,0,0,0,0,0,0,0,0,0,11,0,

%U 0,0,0,0,0,0,0,0,0,0,12,0,0,0,0,0,0,0,0,0,0,0,0,13,0,0,0,0,0,0,0,0,0,0,0,0,0,14,0,0,0,0,0,0,0,0,0,0,0,0,0,0,15

%N Triangle read by rows: row n consists of n zeros followed by n+1.

%C Alternatively, a(n) = k if n+1 is the k-th triangular number and 0 otherwise.

%C Triangle T(n,k), 0<=k<=n, read by rows, given by (0,0,0,0,0,0,0,0,0,0,...) DELTA (2,-1/2,1/2,0,0,0,0,0,0,0,...) where DELTA is the operator defined in A084938. - _Philippe Deléham_, Oct 27 2011

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

%F Infinite lower triangular matrix with (1, 2, 3, ...) in the main diagonal and the rest zeros.

%F This sequence * A007318 (Pascal's Triangle) = A003506.

%F A007318 * this sequence = A103406.

%F G.f.: 1/(x*y-1)^2. - _R. J. Mathar_, Aug 11 2015

%F a(n) = (1/2) (round(sqrt(4 + 2 n)) - round(sqrt(2 + 2 n))) (-1 + round(sqrt(2 + 2 n)) + round(sqrt(4 + 2 n))). - _Brian Tenneson_, Jan 27 2017

%F From _G. C. Greubel_, Mar 13 2024: (Start)

%F T(n, n) = n+1.

%F Sum_{k=0..n} T(n, k) = n+1.

%F Sum_{k=0..n} (-1)^k*T(n, k) = (-1)^n*(n+1).

%F Sum_{k=0..floor(n/2)} T(n-k, k) = A142150(n+2).

%F Sum_{k=0..floor(n/2)} (-1)^k*T(n-k, k) = (-1)^floor(n/2)*A142150(n+2). (End)

%e First few rows of the triangle:

%e 1;

%e 0, 2;

%e 0, 0, 3;

%e 0, 0, 0, 4;

%e 0, 0, 0, 0, 5;

%e 0, 0, 0, 0, 0, 6;

%e 0, 0, 0, 0, 0, 0, 7;

%e ...

%p A127648 := proc(n)

%p for i from 0 do

%p if A000217(i) = n+1 then

%p return i ;

%p elif A000217(i) >n then

%p return 0 ;

%p end if;

%p end do;

%p end proc: # _R. J. Mathar_, Apr 23 2013

%t Flatten[Table[{n,Table[0,{n}]},{n,15}]] (* _Harvey P. Dale_, Jul 27 2011 *)

%o (Haskell)

%o a127648 n k = a127648_tabl !! n !! k

%o a127648_row n = a127648_tabl !! n

%o a127648_tabl = map reverse $ iterate (\(x:xs) -> x + 1 : 0 : xs) [1]

%o a127648_list = concat a127648_tabl

%o -- _Reinhard Zumkeller_, Jul 13 2013

%o (Python)

%o for i in range(1,15):

%o print(i, end=", ")

%o for j in range(i):

%o print("0", end=", ") # _Mohammad Saleh Dinparvar_, May 11 2020

%o (Magma) [k eq n select n+1 else 0: k in [0..n], n in [0..20]]; // _G. C. Greubel_, Mar 12 2024

%o (SageMath)

%o def A127648(n): return (sqrt(9+8*n)-1)//2 if ((sqrt(9+8*n)-3)/2).is_integer() else 0

%o [A127648(n) for n in range(153)] # _G. C. Greubel_, Mar 12 2024

%Y Cf. A003506, A007318, A084938, A010054, A103406, A142150.

%K nonn,easy,tabl

%O 0,3

%A _Gary W. Adamson_, Jan 22 2007