OFFSET
0,24
COMMENTS
Row sums are: {1, 2, 2, 4, 3, 6, 9, 18, 34, 58, 100, ...}.
LINKS
Indranil Ghosh, Rows 0..100, flattened
Indranil Ghosh, Python Program to generate the b-file
Roger L. Bagula, Three methods for computing b(n)
FORMULA
Let b(n) = b(n-1) + b(n-2) - b(n-3) + b(n-5), with b(0) = 0, b(1) = 1, b(2) = 1, b(3) = 2, b(4) = 2 then the triangle is defined as T(n, m) = b(n) - b(m) - b(n-m) + 1.
EXAMPLE
Triangle begins as:
1;
1, 1;
1, 0, 1;
1, 1, 1, 1;
1, 0, 1, 0, 1;
1, 1, 1, 1, 1, 1;
1, 1, 2, 1, 2, 1, 1;
1, 2, 3, 3, 3, 3, 2, 1;
1, 3, 5, 5, 6, 5, 5, 3, 1;
1, 4, 7, 8, 9, 9, 8, 7, 4, 1;
1, 6, 10, 12, 14, 14, 14, 12, 10, 6, 1;
...
T(6,2) = a(6) - a(2) - a(4) + 1 = 4 - 1 - 2 + 1 = 2. - Indranil Ghosh, Feb 18 2017
MATHEMATICA
b[0]:=0; b[1]:=1; b[2]:=1; b[3]:=2; b[4]=2; b[n_]:= b[n-1] +b[n-2] -b[n-3] +b[n-5]; T[n_, m_]:= b[n] -b[m] -b[n-m] +1; Table[T[n, m], {n, 0, 12}, {m, 0, n}]//Flatten (* modified by G. C. Greubel, May 07 2019 *)
PROG
(PARI)
{b(n) = if(n==0, 0, if(n==1, 1, if(n==2, 1, if(n==3, 2, if(n==4, 2, b(n-1) +b(n-2) -b(n-3) +b(n-5))))))};
{T(n, k) = b(n) - b(k) - b(n-k) + 1};
for(n=0, 12, for(k=0, n, print1(T(n, k), ", "))) \\ G. C. Greubel, May 07 2019
(Sage)
def b(n):
if (n==0): return 0
elif (n==1): return 1
elif (n==2): return 1
elif (n==3): return 2
elif (n==4): return 2
else: return b(n-1) +b(n-2) -b(n-3) +b(n-5)
def T(n, k): return b(n) - b(k) - b(n-k) +1
[[T(n, k) for k in (0..n)] for n in (0..12)] # G. C. Greubel, May 07 2019
CROSSREFS
KEYWORD
AUTHOR
Roger L. Bagula, Apr 19 2010
EXTENSIONS
Edited by G. C. Greubel, May 07 2019
STATUS
approved