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.

A204459 Square array A(n,k), n>=0, k>=0, read by antidiagonals: A(n,k) is the number of k-element subsets that can be chosen from {1,2,...,k*n} having element sum k*(k*n+1)/2.

Original entry on oeis.org

1, 0, 1, 0, 1, 1, 0, 1, 0, 1, 0, 1, 2, 1, 1, 0, 1, 0, 3, 0, 1, 0, 1, 8, 8, 4, 1, 1, 0, 1, 0, 33, 0, 5, 0, 1, 0, 1, 58, 141, 86, 25, 6, 1, 1, 0, 1, 0, 676, 0, 177, 0, 7, 0, 1, 0, 1, 526, 3370, 3486, 1394, 318, 50, 8, 1, 1, 0, 1, 0, 17575, 0, 11963, 0, 519, 0, 9, 0, 1
Offset: 0

Views

Author

Alois P. Heinz, Jan 15 2012

Keywords

Comments

A(n,k) is the number of partitions of k*(k*n+1)/2 into k distinct parts <=k*n.
A(n,k) = 0 if k>0 and (n = 0 or k*(k*n+1) mod 2 = 1).

Examples

			A(0,0) = 1: {}.
A(1,1) = 1: {1}.
A(5,1) = 1: {3}.
A(1,5) = 1: {1,2,3,4,5}.
A(2,2) = 2: {1,4}, {2,3}.
A(3,2) = 3: {1,6}, {2,5}, {3,4}.
A(2,3) = 0: no subset of {1,2,3,4,5,6} has element sum 3*(3*2+1)/2 = 21/2.
A(4,2) = 4: {1,8}, {2,7}, {3,6}, {4,5}.
A(3,3) = 8: {1,5,9}, {1,6,8}, {2,4,9}, {2,5,8}, {2,6,7}, {3,4,8}, {3,5,7}, {4,5,6}.
A(2,4) = 8: {1,2,7,8}, {1,3,6,8}, {1,4,5,8}, {1,4,6,7}, {2,3,5,8}, {2,3,6,7}, {2,4,5,7}, {3,4,5,6}.
Square array A(n,k) begins:
  1, 0, 0,  0,   0,    0,     0,      0, ...
  1, 1, 1,  1,   1,    1,     1,      1, ...
  1, 0, 2,  0,   8,    0,    58,      0, ...
  1, 1, 3,  8,  33,  141,   676,   3370, ...
  1, 0, 4,  0,  86,    0,  3486,      0, ...
  1, 1, 5, 25, 177, 1394, 11963, 108108, ...
  1, 0, 6,  0, 318,    0, 32134,      0, ...
  1, 1, 7, 50, 519, 5910, 73294, 957332, ...
		

Crossrefs

Programs

  • Maple
    b:= proc(n, i, t) option remember;
          `if`(it*(2*i-t+1)/2, 0,
          `if`(n=0, 1, b(n, i-1, t) +`if`(n
    				
  • Mathematica
    b[n_, i_, t_] /; it*((2*i-t+1)/2) = 0; b[0, , ] = 1; b[n_, i_, t_] := b[n, i, t] = b[n, i-1, t] + If[n, 0] = 1; a[0, ] = 0; a[n_, k_] := With[{s = k*(k*n+1)}, If[Mod[s, 2] == 1, 0, b[s/2, k*n, k]]]; Flatten[ Table[ a[n, d-n], {d, 0, 15}, {n, 0, d}]] (* Jean-François Alcover, Jun 15 2012, translated from Maple, after Alois P. Heinz *)