login
The OEIS is supported by the many generous donors to the OEIS Foundation.

 

Logo
Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A158821 Triangle read by rows: row n (n>=0) ends with 1, and for n>=1 begins with n; other entries are zero. 8

%I #17 Apr 05 2023 09:34:45

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

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

%U 0,0,0,0,0,0,0,0,0,0,1,12,0,0,0,0,0,0,0,0,0,0,0,1,13,0,0,0,0,0,0,0,0,0,0,0,0,1

%N Triangle read by rows: row n (n>=0) ends with 1, and for n>=1 begins with n; other entries are zero.

%H G. C. Greubel, <a href="/A158821/b158821.txt">Rows n = 0..50 of the triangle, flattened</a>

%F T(n, k) = A145677(n, n-k-1). - _R. J. Mathar_, Apr 01 2009

%F From _G. C. Greubel_, Dec 22 2021: (Start)

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

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

%e Triangle begins:

%e 1;

%e 1, 1;

%e 2, 0, 1;

%e 3, 0, 0, 1;

%e 4, 0, 0, 0, 1;

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

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

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

%p A158821:= proc(n,k)

%p if n = k then 1;

%p elif k = 0 then n;

%p else 0;

%p end if;

%p end proc: # _R. J. Mathar_, Jan 08 2015

%t T[n_, k_]:= If[k==0, Boole[n==0] +n, If[k==n, 1, 0]];

%t Table[T[n, k], {n,0,12}, {k,0,n}]//Flatten (* _G. C. Greubel_, Dec 22 2021 *)

%t Join[{1},Table[Join[{n},PadLeft[{1},n,0]],{n,15}]]//Flatten (* _Harvey P. Dale_, Apr 05 2023 *)

%o (Sage)

%o def A158821(n,k):

%o if (k==0): return n + bool(n==0)

%o elif (k==n): return 1

%o else: return 0

%o flatten([[A158821(n,k) for k in (0..n)] for n in (0..12)]) # _G. C. Greubel_, Dec 22 2021

%Y Cf. A000027, A109613, A145677.

%K nonn,tabl,easy

%O 0,4

%A _Gary W. Adamson_, Mar 30 2008

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recents
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified May 8 23:08 EDT 2024. Contains 372341 sequences. (Running on oeis4.)