OFFSET
1,4
COMMENTS
Here, a multiset is a finite weakly increasing sequence of positive integers.
The first sums of a nonempty sequence (a, b, c, d, ...) are (a+b, b+c, c+d, ...).
EXAMPLE
The multiset {1,3,3,5} has first sums {4,6,8}, so {4,6,8} is counted under a(18). We could also have used {2,2,4,4}.
The a(2) = 1 through a(9) = 7 multisets:
{2} {3} {4} {5} {6} {7} {8} {9}
{2,2} {2,3} {2,4} {2,5} {2,6} {2,7}
{2,2,2} {3,4} {3,5} {3,6}
{2,2,3} {4,4} {4,5}
{2,2,4} {2,2,5}
{2,2,2,2} {2,3,4}
{2,2,2,3}
MATHEMATICA
uncha[tar_, ini_]:=(cur={ini}; Do[AppendTo[cur, tar[[k]]-If[k==1, ini, cur[[k]]]], {k, 1, Length[tar]}]; cur);
greseq[m_]:=Select[Table[uncha[m, i], {i, 1, Max[m]}], LessEqual@@#&]!={};
Table[Length[Select[Reverse/@IntegerPartitions[n], greseq]], {n, 30}]
PROG
(PARI) f(s, x, y) = sum(i=2*x, s\2, f(s-i, max(i-y, (i+1)\2), i-x)) + (s>=2*x);
a(n) = f(n, 1, n); \\ Jinyuan Wang, Nov 28 2025
CROSSREFS
KEYWORD
nonn
AUTHOR
Gus Wiseman, Nov 13 2025
EXTENSIONS
More terms from Jinyuan Wang, Nov 28 2025
STATUS
approved
