In Mathematica I implemented this simple code:
n = 8;
a0 = Range[0, n - 1];
a1 = Subsets[a0, {2}];
a2 = Subsets[a1, {2}];
a3 = Select[a2, Length[Union[Flatten[#]]] == 4 &];
a4 = Subsets[a3, {n/4}];
a5 = Select[a4, Length[Union[Flatten[#]]] == n &];
a6 = Map[Flatten, a5, 1];
where n
can take values such as 4, 8, 12, 16, ...
The problem is that already with n = 12
, you don't get anywhere, because the size of a4
becomes huge. What algorithm could be used to obtain a6
directly from a0
or n
?
In Mathematica I implemented this simple code:
n = 8;
a0 = Range[0, n - 1];
a1 = Subsets[a0, {2}];
a2 = Subsets[a1, {2}];
a3 = Select[a2, Length[Union[Flatten[#]]] == 4 &];
a4 = Subsets[a3, {n/4}];
a5 = Select[a4, Length[Union[Flatten[#]]] == n &];
a6 = Map[Flatten, a5, 1];
where n
can take values such as 4, 8, 12, 16, ...
The problem is that already with n = 12
, you don't get anywhere, because the size of a4
becomes huge. What algorithm could be used to obtain a6
directly from a0
or n
?
1 Answer
Reset to default 0Here is a meta algorithm:
- Calculate the values of
a6
forn
= 0, 1, 2, 3, ... - Look up the resulting sequence on https://oeis./
- Check whether the search results match your expectations and if there is a closed-form solution