|
|
A365305
|
|
a(n) is the smallest nonnegative integer such that the sum of any nine ordered terms a(k), k<=n (repetitions allowed), is unique.
|
|
6
|
|
|
0, 1, 10, 91, 500, 3119, 13818, 59174, 211135, 742330, 2464208, 7616100, 19241477, 56562573
(list;
graph;
refs;
listen;
history;
text;
internal format)
|
|
|
OFFSET
|
1,3
|
|
COMMENTS
|
This is the greedy B_9 sequence.
|
|
LINKS
|
J. Cilleruelo and J. Jimenez-Urroz, B_h[g] sequences, Mathematika (47) 2000, pp. 109-115.
|
|
EXAMPLE
|
a(4) != 72 because 72+1+1+1+1+1+1+1+1+0 = 10+10+10+10+10+10+10+10+0.
|
|
PROG
|
(Python)
def GreedyBh(h, seed, stopat):
A = [set() for _ in range(h+1)]
A[1] = set(seed) # A[i] will hold the i-fold sumset
for j in range(2, h+1): # {2, ..., h}
for x in A[1]:
A[j].update([x+y for y in A[j-1]])
w = max(A[1])+1
while w <= stopat:
wgood = True
for k in range(1, h):
if wgood:
for j in range(k+1, h+1):
if wgood and (A[j].intersection([(j-k)*w + x for x in A[k]]) != set()):
wgood = False
if wgood:
A[1].add(w)
for k in range(2, h+1): # update A[k]
for j in range(1, k):
A[k].update([(k-j)*w + x for x in A[j]])
w += 1
return A[1]
GreedyBh(9, [0], 10000)
(Python)
from itertools import count, islice, combinations_with_replacement
def A365305_gen(): # generator of terms
aset, alist = set(), []
for k in count(0):
bset = set()
for d in combinations_with_replacement(alist+[k], 8):
if (m:=sum(d)+k) in aset:
break
bset.add(m)
else:
yield k
alist.append(k)
aset |= bset
|
|
CROSSREFS
|
|
|
KEYWORD
|
nonn,more
|
|
AUTHOR
|
|
|
EXTENSIONS
|
|
|
STATUS
|
approved
|
|
|
|