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.

Showing 1-2 of 2 results.

A203986 Square array A(n,k), n>=0, k>=0, read by antidiagonals: A(n,k) is the number of partitions of {1,2,...,k*n} into n k-element subsets having the same sum.

Original entry on oeis.org

1, 1, 1, 1, 1, 1, 1, 1, 0, 1, 1, 1, 1, 0, 1, 1, 1, 0, 1, 0, 1, 1, 1, 4, 2, 1, 0, 1, 1, 1, 0, 32, 0, 1, 0, 1, 1, 1, 29, 305, 392, 11, 1, 0, 1, 1, 1, 0, 4331, 0, 6883, 0, 1, 0, 1, 1, 1, 263, 63261, 2097719, 3245664, 171088, 84, 1, 0, 1, 1, 1, 0, 1025113, 0, 2549091482, 0, 5661874, 0, 1, 0, 1
Offset: 0

Views

Author

Alois P. Heinz, Jan 09 2012

Keywords

Comments

A(n,k) = 0 if n>1 and k>0 and (k=1 or k*(n-1) mod 2 = 1).
The element sum of each subset is k*(k*n+1)/2.

Examples

			A(0,0) = 1.
A(1,1) = 1: {1}.
A(2,2) = 1: {1,4}, {2,3}.
A(3,3) = 2: {1,5,9}, {2,6,7}, {3,4,8}; {1,6,8}, {2,4,9}, {3,5,7}.
A(4,2) = 1: {1,8}, {2,7}, {3,6}, {4,5}.
A(2,4) = 4: {1,2,7,8}, {3,4,5,6}; {1,3,6,8}, {2,4,5,7}; {1,4,5,8}, {2,3,6,7}; {1,4,6,7}, {2,3,5,8}.
Square array A(n,k) begins:
  1, 1, 1,  1,    1,       1,          1, ...
  1, 1, 1,  1,    1,       1,          1, ...
  1, 0, 1,  0,    4,       0,         29, ...
  1, 0, 1,  2,   32,     305,       4331, ...
  1, 0, 1,  0,  392,       0,    2097719, ...
  1, 0, 1, 11, 6883, 3245664, 2549091482, ...
		

Crossrefs

Cf. A168238 (bisection of row n=2), A203017 (row n=3), A104185 (bisection of column k=3), A203435 (column k=4).
Main diagonal gives A321230.

Programs

  • Maple
    b:= proc() option remember; local i, j, t, k, m; m:= args[nargs-1]; k:= args[nargs]; if args[1]=0 then `if`(nargs=3, 1, b(args[t] $t=2..nargs)) elif args[1]<1 then 0 else add(`if`(args[j] `if`(n=0 or k=0, 1, b((k*(n*k+1)/2 +k/97) $n, k*n, k)/n!):
    seq(seq(A(n, d-n), n=0..d), d=0..10);
  • Mathematica
    b[args_List] := b[args] = Module[{nargs = Length[args], k = args[[-1]], m = args[[-2]]}, Which[args[[1]] == 0, If[nargs == 3, 1, b[args[[2 ;; nargs]]]], args[[1]] < 1, 0, True, Sum[If[args[[j]] < m, 0, b[Join[Sort[Table[args[[i]] - If[i == j, m + 1/97, 0], {i, 1, nargs - 2}]], {m - 1, k}]]], {j, 1, nargs - 2}] ]]; A[n_, k_] := If[n == 0 || k == 0, 1, b[Join[Array[(k*(n*k + 1)/2 + k/97) &, n], {k*n, k}]]/n!]; Table[Table[A[n, d - n], {n, 0, d}], {d, 0, 10}] // Flatten (* Jean-François Alcover, Jan 21 2015, after Alois P. Heinz *)

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 *)
Showing 1-2 of 2 results.