OFFSET
1,5
LINKS
Alois P. Heinz, Table of n, a(n) for n = 1..1000
FORMULA
G.f.: Sum_{m>=1} (x^(m^2) - x^(m*(m+1)))/(1-x)^m.
EXAMPLE
a(9)=3 because we have [2,7], [7,2] and [3,3,3].
MAPLE
G:=sum((x^(m^2)-x^(m*(m+1)))/(1-x)^m, m=1..35):Gser:=series(G, x=0, 60): seq(coeff(Gser, x^n), n=1..58); # Emeric Deutsch, Apr 18 2005
# second Maple program:
b:= proc(n, s, c) option remember; `if`(s<c, 0, `if`(n=0,
`if`(s=c, 1, 0), add(b(n-j, min(j, s), c+1), j=1..n)))
end:
a:= n-> b(n$2, 0):
seq(a(n), n=1..52); # Alois P. Heinz, Oct 01 2021
MATHEMATICA
b[n_, s_, c_] := b[n, s, c] = If[s < c, 0, If[n == 0,
If[s == c, 1, 0], Sum[b[n - j, Min[j, s], c + 1], {j, 1, n}]]];
a[n_] := b[n, n, 0];
Table[a[n], {n, 1, 52}] (* Jean-François Alcover, Mar 13 2022, after Alois P. Heinz *)
CROSSREFS
KEYWORD
easy,nonn
AUTHOR
Vladeta Jovovic, Sep 27 2004
EXTENSIONS
More terms from Emeric Deutsch, Apr 18 2005
STATUS
approved