OFFSET
1,3
COMMENTS
This is a greedy B_10 sequence beginning with 0.
LINKS
EXAMPLE
a(3)!=10 because 10+0+0+0+0+0+0+0+0+0 = 1+1+1+1+1+1+1+1+1+1.
PROG
(Python)
import itertools
def greedy_bh(h, start):
terms, sums = [], set()
def test_candidate(candidate):
new_sums = []
for copies in range(1, h + 1):
for combo in itertools.combinations_with_replacement(terms, h - copies):
candidate_sum = sum(combo) + candidate * copies
# No need to check candidate_sum against the other values in
# `new_sums`: any collision between two new sums, one with r
# copies and one with s (r < s), reduces to a new-vs-old
# collision at s-r copies, which is caught earlier.
if candidate_sum in sums:
return None
new_sums.append(candidate_sum)
return new_sums
for candidate in itertools.count(start):
if (candidate_sums := test_candidate(candidate)) is not None:
yield candidate
terms.append(candidate)
sums.update(candidate_sums)
a397311_list = list(itertools.islice(greedy_bh(10, 0), 5))
CROSSREFS
KEYWORD
nonn,more,new
AUTHOR
Adam Reichert, Jun 20 2026
STATUS
approved
