OFFSET
0,6
LINKS
Alois P. Heinz, Table of n, a(n) for n = 0..1000
EXAMPLE
a(7) counts these 7 partitions: 511, 4111, 322, 3211, 31111, 22111, 211111.
MAPLE
b:= proc(n, i, k) option remember; `if`(n=0, `if`(k=0, 1, 0),
`if`(i<1, 0, b(n, i-1, k) +add(b(n-i*j, i-1, `if`(k=-1, j,
`if`(k=0, 0, `if`(j>k, 0, k)))), j=1..n/i)))
end:
a:= n-> b(n$2, -1):
seq(a(n), n=0..70); # Alois P. Heinz, Apr 12 2014
MATHEMATICA
z = 60; f[n_] := f[n] = IntegerPartitions[n]; m[p_] := Max[Map[Length, Split[p]]] (* maximal multiplicity *)
Table[Count[f[n], p_ /; m[p] == Count[p, Max[p]]], {n, 0, z}] (* A171979 *)
Table[Count[f[n], p_ /; m[p] > Count[p, Max[p]]], {n, 0, z}] (* A240302 *)
(* Second program: *)
b[n_, i_, k_] := b[n, i, k] = If[n == 0, If[k == 0, 1, 0],
If[i < 1, 0, b[n, i - 1, k] + Sum[b[n - i*j, i - 1, If[k == -1, j,
If[k == 0, 0, If[j > k, 0, k]]]], {j, 1, n/i}]]];
a[n_] := b[n, n, -1];
a /@ Range[0, 70] (* Jean-François Alcover, Jun 05 2021, after Alois P. Heinz *)
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
Clark Kimberling, Apr 04 2014
STATUS
approved