cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

A176482 Triangle, read by rows, defined by T(n, k) = b(n) - b(k) - b(n-k) + 1 (see formula section for recurrence for b(n)).

Original entry on oeis.org

1, 1, 1, 1, 3, 1, 1, 9, 9, 1, 1, 29, 35, 29, 1, 1, 94, 120, 120, 94, 1, 1, 304, 395, 415, 395, 304, 1, 1, 983, 1284, 1369, 1369, 1284, 983, 1, 1, 3179, 4159, 4454, 4519, 4454, 4159, 3179, 1, 1, 10281, 13457, 14431, 14706, 14706, 14431, 13457, 10281, 1
Offset: 0

Views

Author

Roger L. Bagula, Apr 18 2010

Keywords

Examples

			Triangle begins as:
  1;
  1,     1;
  1,     3,     1;
  1,     9,     9,     1;
  1,    29,    35,    29,     1;
  1,    94,   120,   120,    94,     1;
  1,   304,   395,   415,   395,   304,     1;
  1,   983,  1284,  1369,  1369,  1284,   983,     1;
  1,  3179,  4159,  4454,  4519,  4454,  4159,  3179,     1;
  1, 10281, 13457, 14431, 14706, 14706, 14431, 13457, 10281,     1;
  1, 33249, 43527, 46697, 47651, 47861, 47651, 46697, 43527, 33249, 1;
...
T(4,3) = a(4) - a(3) - a(4 - 3) + 1 = 42 - 13 - 1 + 1 = 29. - _Indranil Ghosh_, Feb 18 2017
		

Crossrefs

Cf. A095263.

Programs

  • Mathematica
    b[0]:=0; b[1]:=1; b[2]:=4; b[3]=13; b[n_]:= b[n]= 4*b[n-1] -3*b[n-2] + 2*b[n-3] -b[n-4]; T[n_, m_]:=b[n]-b[m]-b[n-m]+1; Table[T[n, m], {n,0,12}, {m,0,n}]//Flatten
  • PARI
    {b(n) = if(n==0, 0, if(n==1, 1, if(n==2, 4, if(n==3, 13, 4*b(n-1) -3*b(n-2) + 2*b(n-3) -b(n-4)))))};
    {T(n,k) = b(n) -b(k) -b(n-k) +1};
    for(n=0,10, for(k=0,n, print1(T(n,k), ", "))) \\ G. C. Greubel, May 06 2019
    
  • Python
    # see Indranil Ghosh link
    
  • Sage
    def b(n):
        if (n==0): return 0
        elif (n==1): return 1
        elif (n==2): return 4
        elif (n==3): return 13
        else: return 4*b(n-1) -3*b(n-2) +2*b(n-3) -b(n-4)
    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 06 2019

Formula

With b(n) = 4*b(n-1) - 3*b(n-2) + 2*b(n-3) - b(n-4), with b(0) = 0, b(1) = 1, b(2) = 4 and b(3) = 13, then the triangle is generated by T(n, k) = b(n) - b(k) - b(n-k) + 1.

Extensions

Name and formula sections edited by Indranil Ghosh, Feb 18 2017
Edited by G. C. Greubel, May 06 2019