An Egyptian fraction is a representation of a rational number using the sum of distinct unit fractions (a unit fraction is of the form \$ \frac 1 x \$ where \$ x \$ is a positive integer).
For all[1] positive integers \$ n \ne 2 \$, there exists at least one Egyptian fraction of \$ n \$ distinct positive integers whose sum is \$ 1 \$. For example, for \$ n = 4 \$: $$ \frac 1 2 + \frac 1 4 + \frac 1 6 + \frac 1 {12} = 1 $$ Here is another possible output: $$ \frac 1 2 + \frac 1 3 + \frac 1 {10} + \frac 1 {15} = 1 $$
The number of possible outputs is given by A006585 in the OEIS.
[1]: I cannot find a direct proof of this, but I can find a proven lower bound on A006585, which has this as an obvious consequence. If you can find (or write!) a better / more direct proof that a representation exists for all \$ n \ne 2 \$ I would love to hear it.
Task
Given \$ n \$, output a list of positive integers representing the denominators of at least one valid solution of length \$ n \$.
You may alternatively output a list of rational numbers which are unit fractions, but only if they are an exact representation of the value (so not floating-point).
Test cases
I only list a few possible outputs. Here is a Ruby program which can verify any solution.
n outputs
1 {1}
3 {2, 3, 6}
4 {2, 4, 6, 12} or {2, 3, 10, 15} or {2, 3, 9, 18} or {2, 4, 5, 20} or {2, 3, 8, 24} or {2, 3, 7, 42} or ...
5 {2, 4, 10, 12, 15} or {2, 4, 9, 12, 18} or {3, 4, 5, 6, 20} or {2, 5, 6, 12, 20} or {2, 4, 8, 12, 24} or {2, 4, 7, 14, 28} or ...
8 {4, 5, 6, 9, 10, 15, 18, 20} or {3, 5, 9, 10, 12, 15, 18, 20} or {3, 6, 8, 9, 10, 15, 18, 24} or {4, 5, 6, 8, 10, 15, 20, 24} or {3, 5, 8, 10, 12, 15, 20, 24} or {4, 5, 6, 8, 9, 18, 20, 24} or ...
15 {6, 8, 9, 11, 14, 15, 18, 20, 21, 22, 24, 28, 30, 33, 35} or {7, 8, 10, 11, 12, 14, 15, 18, 20, 22, 24, 28, 30, 33, 36} or {6, 8, 10, 11, 12, 15, 18, 20, 21, 22, 24, 28, 30, 33, 36} or {6, 8, 10, 11, 12, 14, 18, 20, 21, 22, 24, 28, 33, 35, 36} or {5, 8, 11, 12, 14, 15, 18, 20, 21, 22, 24, 28, 33, 35, 36} or {5, 8, 10, 11, 14, 15, 18, 21, 22, 24, 28, 30, 33, 35, 36} or ...
Rules
- You may output the numbers in any order
- If you choose to output all possible solutions, or a particular subset of them, you must not output duplicates. This includes lists which are the same under some permutation.
- You may assume \$ n \$ is a positive integer, and is not \$ 2 \$
- Your code does not need to practically handle very high \$ n \$, but it must work in theory for all \$ n \$ for which a solution exists
- You may use any standard I/O method
- Standard loopholes are forbidden
- This is code-golf, so the shortest code in bytes wins