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.

A337520 Number of set partitions of [4n] into 4-element subsets {i, i+k, i+2k, i+3k} with 1<=k<=n.

Original entry on oeis.org

1, 1, 2, 4, 10, 22, 64, 147, 409, 1092, 3253, 8661, 28585, 83190, 274001, 912373, 3366384, 13253582, 61533277, 290493694
Offset: 0

Views

Author

Alois P. Heinz, Nov 18 2020

Keywords

Examples

			a(4) = 10: {{1,2,3,4}, {5,6,7,8}, {9,10,11,12}, {13,14,15,16}},
  {{1,3,5,7}, {2,4,6,8}, {9,10,11,12}, {13,14,15,16}},
  {{1,2,3,4}, {5,7,9,11}, {6,8,10,12}, {13,14,15,16}},
  {{1,4,7,10}, {2,5,8,11}, {3,6,9,12}, {13,14,15,16}},
  {{1,2,3,4}, {5,6,7,8}, {9,11,13,15}, {10,12,14,16}},
  {{1,3,5,7}, {2,4,6,8}, {9,11,13,15}, {10,12,14,16}},
  {{2,4,6,8}, {1,5,9,13}, {3,7,11,15}, {10,12,14,16}},
  {{1,2,3,4}, {5,8,11,14}, {6,9,12,15}, {7,10,13,16}},
  {{1,3,5,7}, {2,6,10,14}, {9,11,13,15}, {4,8,12,16}},
  {{1,5,9,13}, {2,6,10,14}, {3,7,11,15}, {4,8,12,16}}.
		

Crossrefs

Main diagonal of A360333.

Programs

  • Maple
    b:= proc(s, t) option remember; `if`(s={}, 1, (m-> add(
         `if`({seq(m-h*j, h=1..3)} minus s={}, b(s minus {seq(m-h*j,
          h=0..3)}, t), 0), j=1..min(t, iquo(m-1, 3))))(max(s)))
        end:
    a:= proc(n) option remember; forget(b): b({$1..4*n}, n) end:
    seq(a(n), n=0..12);
  • Mathematica
    b[s_, t_] := b[s, t] = If[s == {}, 1, Function[m, Sum[       If[Union@Table[m-h*j, {h, 1, 3}] ~Complement~ s == {}, b[s ~Complement~ Union@Table[m-h*j, {h, 0, 3}], t], 0], {j, 1, Min[t, Quotient[m-1, 3]]}]][Max[s]]];
    a[n_] := a[n] = b[Range[4n], n];
    Table[Print[n, " ", a[n]]; a[n], {n, 0, 12}] (* Jean-François Alcover, Feb 13 2023, after Alois P. Heinz *)