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.

User: Nicolas Nagel

Nicolas Nagel's wiki page.

Nicolas Nagel has authored 1 sequences.

A318301 Triangle T(n, k) read by rows: T(0, 0) = 1 and T(n, k) = Sum_{i=0..k-1} T(n, i) + Sum_{i=k..n-1} T(n-1, i).

Original entry on oeis.org

1, 1, 1, 2, 3, 5, 10, 18, 33, 61, 122, 234, 450, 867, 1673, 3346, 6570, 12906, 25362, 49857, 98041, 196082, 388818, 771066, 1529226, 3033090, 6016323, 11934605, 23869210, 47542338, 94695858, 188620650, 275712074, 748391058, 1490765793, 2969596981, 5939193962, 11854518714
Offset: 0

Author

Nicolas Nagel, Aug 24 2018

Keywords

Comments

The left edge of the triangle appears to be A005321.

Examples

			Triangle begins:
     1
     1    1
     2    3     5
    10   18    33    61
   122  234   450   867  1673
  3346 6570 12906 25362 49857 98041
  ...
T(5, 2) = (3346 + 6570) + (450 + 867 + 1673) = 12906;
T(5, 2) = 2 * 6570 - 234 = 12906.
		

Crossrefs

Cf. A005321.

Programs

  • PARI
    T(n, k) = if (k == 0, if (n <= 1, 1, 2 * T(n-1, n-1)), 2 * T(n, k-1) - T(n-1, k-1));
    tabl(nn) = for (n=0, nn, for (k=0, n, print1(T(n,k), ", ")); print); \\ Michel Marcus, Aug 25 2018
  • Python
    def T(n, k):
        if k == 0:
            if n == 0 or n == 1:
                return 1
            return 2 * T(n-1, n-1)
        return 2 * T(n, k-1) - T(n-1, k-1)
    

Formula

An equivalent recursion: T(0, 0) = T(1, 0) = 1, T(n, 0) = 2*T(n-1, n-1) if n>=2, T(n, k) = 2*T(n, k-1) - T(n-1, k-1) if n>=k>=1.