OFFSET
0,3
LINKS
Chai Wah Wu, Table of n, a(n) for n = 0..158 (n = 0..120 from Alois P. Heinz)
EXAMPLE
a(0) = 1: the empty partition.
a(1) = 1: 1.
a(2) = 2: 11, 2.
a(3) = 1: 21.
a(4) = 1: 211.
a(5) = 4: 2111, 221, 311, 32.
a(6) = 2: 2211, 321.
a(7) = 5: 22111, 2221, 3211, 322, 331.
a(8) = 5: 22211, 32111, 3221, 3311, 332.
a(9) = 9: 222111, 321111, 32211, 3222, 33111, 3321, 42111, 4311, 432.
a(10) = 8: 2221111, 322111, 32221, 331111, 33211, 4222, 4321, 433.
MAPLE
b:= proc(n, i, s) option remember;
`if`(n=0, `if`(s={$0..max(s)}, 1, 0), `if`(i<1, 0, add(
b(n-i*j, i-1, {s[], j, `if`(j=0, 0, i)}), j=0..n/i)))
end:
a:= n-> b(n, floor((sqrt(1+8*(n+1))-1)/2), {0}):
seq(a(n), n=0..55);
MATHEMATICA
b[n_, i_, s_] := b[n, i, s] =
If[n == 0, If[s == Range[0, Max[s]], 1, 0], If[i < 1, 0, Sum[
b[n-i*j, i-1, Union@Flatten@{s, j, If[j == 0, 0, i]}], {j, 0, n/i}]]];
a[n_] := b[n, Floor[(Sqrt[1 + 8*(n + 1)] - 1)/2], {0}];
Table[a[n], {n, 0, 55}] (* Jean-François Alcover, May 30 2022, after Alois P. Heinz *)
CROSSREFS
KEYWORD
nonn
AUTHOR
Alois P. Heinz, Jun 30 2020
STATUS
approved