login
A391537
Guaranteed win if opponent chooses one of two baskets and the player chooses the coins with values from 1 to n (see Comments for details).
4
1, 2, 4, 7, 10, 13, 17, 22, 27, 32, 38, 45, 52, 59, 67, 76, 85, 94, 104, 115, 126, 137, 149, 162, 175, 188, 202, 217, 232, 247, 263, 280, 297, 314, 332, 351, 370, 389, 409, 430, 451, 472, 494, 517, 540, 563, 587, 612, 637, 662, 688, 715, 742, 769, 797
OFFSET
1,2
COMMENTS
At each of n turns your opponent chooses one of two baskets and then you choose one out of n coins which have the values from 1 to n. The coin chosen by you goes in the basket chosen by your opponent. After the last turn, you may choose which basket you take and which basket your opponent will get. a(n) is the guaranteed sum that you can achieve with the optimum strategy.
FORMULA
a(n) = floor(n*(n-1)/4) + n.
a(n) = A054925(n+2)-1.
a(n) = A186353(n-1)+1 for n>1.
a(n) = A192447(n+2)/2-1.
a(n) = (A213484(n+1)-4)/3.
a(n) = A350394(n+1)-1 for 9<=n<=k with k>=61.
a(n) = (A373584(n+2)-7)/6.
EXAMPLE
a(7) = 17. The optimum strategy is to distribute as evenly as possible the first n-1 coins between the two baskets. For 7 coins, the first 6 coins sum up to 21, which means you need to put the sum of 10 in one basket and the sum of 11 in the second basket (e.g. you reserve the coins 1, 3 and 6 for the first basket and the coins 2, 4 and 5 for the second basket). In the last turn your opponent will propose the basket with the smaller sum in which you will place coin 7 and your total win is 17. If the opponent is proposing the first basket when it contains already the sum of 10 before the second basket contains a sum of 11, you put immediately coin 7 in the first basket and you have achieved already your optimum gain.
PROG
(Python)
n_chest = 2
n_coins = 7
chest = [0 for i in range(n_chest)]
coins = [i+1 for i in range(n_coins)]
def next(coins, chest):
if len(coins) == 1:
maxcoins = max(min(chest)+coins[0], max(chest))
else:
maxcoins = 9999
for i in range(n_chest):
maxcoinsi = 0
for j in coins:
chest[i] += j
coins_next = copy(coins)
coins_next.remove(j)
maxcoinsj = next(coins_next, chest)
if maxcoinsj > maxcoinsi:
maxcoinsi = maxcoinsj
chest[i] -= j
if maxcoinsi < maxcoins:
maxcoins = maxcoinsi
return maxcoins
print(next(coins, chest))
CROSSREFS
Cf. A391538 (same game with 3 baskets), A054925, A186353, A192447, A213484, A350394, A373584, A391791, A391792.
Sequence in context: A368784 A126022 A194172 * A173537 A390396 A049983
KEYWORD
nonn
AUTHOR
Ruediger Jehn, Dec 12 2025
STATUS
approved