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.

A227850 Number of Dyck paths of semilength n*(4*n+1) in which the run length sequence is a permutation of {1,...,4*n}.

Original entry on oeis.org

1, 4, 1248, 5401472, 114070692352, 7593330670240768
Offset: 0

Views

Author

David Scambler and Alois P. Heinz, Oct 31 2013

Keywords

Examples

			a(1) = 4: UUDUUUDDDD (2134), UUUDUUDDDD (3124), UUUUDDUDDD (4213), UUUUDDDUDD (4312).
		

Crossrefs

Programs

  • Maple
    h:= proc(n, s) option remember;
           `if`(n>add(sort([s[]], `>`)[i], i=1..(nops(s)+1)/2), 0,
           add(g(n-i, s minus {i}), i=select(x-> x<=n, s)))
        end:
    g:= proc(n, s) option remember;
           `if`(s={}, `if`(n=0, 1, 0), add(h(n+i, s minus {i}), i=s))
        end:
    a:= n-> g(0, {$1..4*n}):
    seq(a(n), n=0..3);
  • Mathematica
    h[n_, s_] := h[n, s] = If[n > Sum[Sort[s, Greater][[i]], {i, 1, (Length[s] + 1)/2}], 0, Sum[g[n - i, s ~Complement~ {i}], {i, Select[s, # <= n&]}] ];
    g[n_, s_] := g[n, s] = If[s == {}, If[n == 0, 1, 0], Sum[h[n + i, s  ~Complement~ {i}], {i, s}]];
    a[n_] := g[0, Range[4*n]];
    Table[a[n], {n, 0, 4}] (* Jean-François Alcover, Apr 23 2016, translated from Maple *)