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.

A238761 Subtriangle of the generalized ballot numbers, T(n,k) = A238762(2*k-1,2*n-1), 1<=k<=n, read by rows.

Original entry on oeis.org

1, 2, 3, 3, 8, 10, 4, 15, 30, 35, 5, 24, 63, 112, 126, 6, 35, 112, 252, 420, 462, 7, 48, 180, 480, 990, 1584, 1716, 8, 63, 270, 825, 1980, 3861, 6006, 6435, 9, 80, 385, 1320, 3575, 8008, 15015, 22880, 24310, 10, 99, 528, 2002, 6006, 15015, 32032, 58344, 87516, 92378
Offset: 1

Views

Author

Peter Luschny, Mar 05 2014

Keywords

Examples

			[n\k 1   2    3    4    5    6     7 ]
[1]  1,
[2]  2,  3,
[3]  3,  8,  10,
[4]  4, 15,  30,  35,
[5]  5, 24,  63, 112, 126,
[6]  6, 35, 112, 252, 420,  462,
[7]  7, 48, 180, 480, 990, 1584, 1716.
		

Crossrefs

Row sums are A002054.

Programs

  • Maple
    binom2 := proc(n, k) local h;
       h := n -> (n-((1-(-1)^n)/2))/2;
       n!/(h(n-k)!*h(n+k)!) end:
    A238761 := (n, k) -> binom2(n+k, n-k+1)*(n-k+1)/(n+k):
    seq(print(seq(A238761(n, k), k=1..n)), n=1..7);
  • Mathematica
    h[n_] := (n - ((1 - (-1)^n)/2))/2;
    binom2[n_, k_] := n!/(h[n-k]! h[n+k]!);
    T[n_, k_] := binom2[n+k, n-k+1] (n-k+1)/(n+k);
    Table[T[n, k], {n, 1, 10}, {k, 1, n}] // Flatten (* Jean-François Alcover, Jul 10 2019, from Maple *)
  • Sage
    @CachedFunction
    def ballot(p, q):
        if p == 0 and q == 0: return 1
        if p < 0 or p > q: return 0
        S = ballot(p-2, q) + ballot(p, q-2)
        if q % 2 == 1: S += ballot(p-1, q-1)
        return S
    A238761 = lambda n, k: ballot(2*k-1, 2*n-1)
    for n in (1..7): [A238761(n, k) for k in (1..n)]

Formula

T(n,n) = A001700(n-1).
T(n,n-1) = A162551(n-1).