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-5 of 5 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 *)

A203435 Number of partitions of {1,2,...,4n} into n 4-element subsets having the same sum.

Original entry on oeis.org

1, 1, 4, 32, 392, 6883, 171088, 5661874, 242038179, 13147317481
Offset: 0

Views

Author

Alois P. Heinz, Jan 01 2012

Keywords

Comments

The element sum of each subset is 8n+2. The larger terms were computed with Knuth's dancing links algorithm.

Examples

			a(1) = 1: {1,2,3,4}.
a(2) = 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}.
		

Crossrefs

Column k=4 of A203986.

Programs

  • Maple
    b:= proc() option remember; local i, j, t, m; m:= args[nargs]; if args[1]=0 then `if`(nargs=2, 1, b(args[t] $t=2..nargs)) elif args[1]<1 then 0 else add(`if`(args[j] `if`(n=0, 1, b(((8*n+2)+4/97) $n, 4*n)/n!): seq(a(n), n=0..6);
  • Mathematica
    b[l_] := b[l] = Module[{nl = Length[l], k = l[[-1]], m = l[[-2]]}, Which[l[[1]] == 0, If[nl == 3, 1, b[l[[2 ;; nl]]]], l[[1]] < 1, 0, True, Sum[If[l[[j]] < m, 0, b[Join[Sort[Table[l[[i]] - If[i == j, m + 1/97, 0], {i, 1, nl - 2}]], {m - 1, k}]]], {j, 1, nl - 2}]]];
    a[n_] := If[n == 0, 1, b[Join[Array[8*n + 2 + 4/97& , n], {4*n, 4}]]/n!];
    Table[a[n], {n, 0, 6}] (* Jean-François Alcover, Jun 03 2018, adapted from Maple *)

A264813 Number of permutations of 3 indistinguishable copies of 1,...,n such that the first and second copies of j are adjacent and there are exactly j numbers between the second and the third copy of j.

Original entry on oeis.org

1, 0, 1, 1, 0, 3, 6, 0, 53, 199, 0, 2908, 13699, 0, 369985, 2135430, 0, 87265700, 611286653, 0
Offset: 0

Views

Author

Alois P. Heinz, Nov 25 2015

Keywords

Comments

a(n) = 0 for n == 1 (mod 3).

Examples

			a(0) = 1: the empty permutation.
a(2) = 1: 221121.
a(3) = 1: 223321131.
a(5) = 3: 223325534411514, 225523344531141, 552244253341131.
a(6) = 6: 221121665544336543, 225523366534411614, 225526633544361141, 446611415563322532, 552266253344631141, 665544336543221121.
		

Crossrefs

A204467 Number of 3-element subsets that can be chosen from {1,2,...,6*n+3} having element sum 9*n+6.

Original entry on oeis.org

1, 8, 25, 50, 85, 128, 181, 242, 313, 392, 481, 578, 685, 800, 925, 1058, 1201, 1352, 1513, 1682, 1861, 2048, 2245, 2450, 2665, 2888, 3121, 3362, 3613, 3872, 4141, 4418, 4705, 5000, 5305, 5618, 5941, 6272, 6613, 6962, 7321, 7688, 8065, 8450, 8845, 9248, 9661
Offset: 0

Views

Author

Alois P. Heinz, Jan 16 2012

Keywords

Comments

a(n) is the number of partitions of 9*n+6 into 3 distinct parts <= 6*n+3.

Examples

			a(1) = 8 because there are 8 3-element subsets that can be chosen from {1,2,...,9} having element sum 15: {1,5,9}, {1,6,8}, {2,4,9}, {2,5,8}, {2,6,7}, {3,4,8}, {3,5,7}, {4,5,6}.
		

Crossrefs

Bisection of column k=3 of A204459.
Cf. A104185.

Programs

  • Maple
    a:= n-> 1 +floor((3+9/2*n)*n):
    seq(a(n), n=0..50);
  • Mathematica
    Table[(6n(3n+2)+(-1)^n+3)/4,{n,0,50}] (* or *) LinearRecurrence[{2,0,-2,1},{1,8,25,50},50] (* Harvey P. Dale, May 25 2015 *)

Formula

a(n) = 1+floor((3+9/2*n)*n).
G.f.: -(2*x+1)*(x^2+4*x+1)/((x+1)*(x-1)^3).
a(n) = (6*n*(3*n+2)+(-1)^n+3)/4. - Bruno Berselli, Jan 17 2012
a(0)=1, a(1)=8, a(2)=25, a(3)=50, a(n)=2*a(n-1)-2*a(n-3)+a(n-4). - Harvey P. Dale, May 25 2015

A321230 Number of set partitions of [n^2] into n n-element subsets having the same sum.

Original entry on oeis.org

1, 1, 1, 2, 392, 3245664, 6534071578530
Offset: 0

Views

Author

Alois P. Heinz, Oct 31 2018

Keywords

Examples

			a(0) = 1: empty.
a(1) = 1: 1.
a(2) = 1: 14|23.
a(3) = 2: 168|249|357, 159|267|348.
		

Crossrefs

Main diagonal of A203986.

Formula

a(n) = A203986(n,n).
Showing 1-5 of 5 results.