OFFSET
0,6
LINKS
Alois P. Heinz, Table of n, a(n) for n = 0..1000
Wikipedia, Counting lattice paths
EXAMPLE
a(5) = 2: 221, 5.
a(11) = 4: 33221, 443, 551, (11).
a(12) = 3: 33321, 552, (12).
a(15) = 6: 44331, 44421, 55221, 663, 771, (15).
MAPLE
b:= proc(n, i, c) option remember; `if`(n=0, `if`(c=0, 1, 0),
`if`(min(i, c)<1, 0, add(b(n-i*j, i-1,
`if`(j=0, c, c+j-2)), j=0..n/i)))
end:
a:= n-> `if`(n=0, 1, b(n$2, 1)):
seq(a(n), n=0..100);
MATHEMATICA
b[n_, i_, c_] := b[n, i, c] = If[n == 0, If[c == 0, 1, 0], If[Min[i, c] < 1, 0, Sum[b[n - i*j, i - 1, If[j == 0, c, c + j - 2]], {j, 0, n/i}]]];
a[n_] := If[n == 0, 1, b[n, n, 1]];
Table[a[n], {n, 0, 100}] (* Jean-François Alcover, May 28 2018, from Maple *)
CROSSREFS
KEYWORD
nonn
AUTHOR
Alois P. Heinz, May 18 2018
STATUS
approved