The project implements the computation of the problem below in two versions: a non-recursive (but still single-threaded) version and a parallel (multi-threaded) version.
For a given multiset of natural numbers
Definition. A multiset
Definition. A pair of
In other words,
Problem. For a fixed
Example.
Proof sketch. The sets $A={\underbrace{d, \ldots, d}{d-1\text{ times}}}$ and $B={\underbrace{d-1,\ldots,d-1}{d\text{ times}}}$ satisfy the conditions with
Example.
Proof sketch. The sets $A={1, \underbrace{d, \ldots, d}{d-2\text{ times}}}$ and $B={\underbrace{d-1,\ldots,d-1}{d-1\text{ times}}}$ satisfy the conditions with
It can be proven that the above examples are optimal, i.e.,
Nevertheless, in this task, we aim to verify this computationally for the largest possible values of
The values of
Solve(d, A, B):
if $\sum A>\sum B$ then swap(A, B)
$S \gets A^{\Sigma}\cap B^{\Sigma}$
if $\sum A=\sum B$ then
if $S=\{0, \sum A\}$ then return $\sum A$
else return 0
else if $S=\{0\}$ then
return $\max_{x \in \{\text{last} A, \dots, d\} \setminus B ^ {\Sigma} } \text{Solve}(d, A\cup\{x\}, B)$
else return 0
where last A denotes the last element added to