OFFSET
0,3
COMMENTS
a(0) = 1 by convention.
LINKS
Alois P. Heinz, Table of n, a(n) for n = 0..1000
Wikipedia, Integer Partition
FORMULA
EXAMPLE
a(2) = 4: 2, 11, 21, 211.
a(3) = 10: 3, 31, 32, 111, 311, 321, 2111, 3111, 3211, 32111.
a(4) = 44: 4, 22, 41, 42, 43, 221, 322, 411, 421, 422, 431, 432, 1111, 2211, 3221, 4111, 4211, 4221, 4311, 4321, 4322, 21111, 22111, 31111, 32211, 41111, 42111, 42211, 43111, 43211, 43221, 221111, 321111, 322111, 421111, 422111, 431111, 432111, 432211, 3221111, 4221111, 4321111, 4322111, 43221111.
MAPLE
b:= proc(n, i, m, t) option remember; `if`(n=0, m,
`if`(i<1 or m=0 and n<t, 0, add(b(n-i*j, i-1,
`if`(t=i*j, 1, m), t), j=0..min(t, n)/i)))
end:
a:= proc(k) option remember; local r, n, t; r:=0;
for n from k do t:= b(n$2, 0, k);
if t=0 then break else r:=r+t fi od; r
end: a(0):=1:
seq(a(n), n=0..20);
MATHEMATICA
$RecursionLimit = 2000;
b[n_, i_, m_, t_] := b[n, i, m, t] = If[n==0, m, If[i<1 || m==0 && n<t, 0, Sum[b[n - i j, i-1, If[t == i j, 1, m], t], {j, 0, Min[t, n]/i}]]];
a[0] = 1;
a[k_] := a[k] = Module[{r = 0, n, t}, For[n = k, True, n++, t = b[n, n, 0, k]; If[t == 0, Break[], r += t]]; r];
a /@ Range[0, 27] (* Jean-François Alcover, May 08 2020, after Maple *)
CROSSREFS
KEYWORD
nonn
AUTHOR
Alois P. Heinz, Feb 07 2020
STATUS
approved