A385675 For positive integers n, a multiset A of positive integers is called "n-good" if for any number 1 <= i <= n, we can find a submultiset B of A such that the sum of B is equal to i. a(n) is the number of minimal n-good multisets.
1, 2, 3, 7, 9, 18, 27, 47, 62, 101, 140, 226, 301, 437, 579, 838, 1077, 1525, 1985, 2721, 3470, 4674, 5899, 7843, 9773, 12703, 15803, 20431, 25129, 32167, 39519, 49982, 60928, 76373, 92537, 115313, 138969, 171372, 205847, 252604, 301444, 367890, 438145, 531202, 630209
Offset: 1
Keywords
Examples
For n = 6, {1, 2, 3} and {1, 1, 3, 6} are minimal n-good multisets.
Crossrefs
Cf. A126796.
Programs
-
Python
# for illustrative purposes from functools import cache from itertools import chain, combinations, combinations_with_replacement as cwr def f(t): return tuple(e for e in t if e != 0) def powerset(s): return chain.from_iterable(combinations(s, r) for r in range(len(s)+1)) @cache def good(n, A): return 1 in A and sum(A) >= n and set(range(1, n+1))-set(sum(B) for B in powerset(A)) == set() def a(n): return sum(good(n, A) and all(not good(n, A[:i]+A[i+1:]) for i in range(len(A))) for A in map(f, cwr(range(n+1), n))) print([a(n) for n in range(1, 11)]) # Michael S. Branicky, Aug 13 2025
Comments