Answer: for all n≥3.
Assume n≥3. Let us introduce such denotations:
a1+a2+⋯+an−1=a,a1a2…an−1=A,b1+b2+⋯+bn−1=b,b1b2…bn−1=B.(1)
Then we can write that a+an=b+bn, Aan=Bbn, and hence,
BAanan=bn⇒a+an=b+BAan⇒Ban−Aan=bB−aB⇒=B−AB(b−a)⇒bn=B−AA(b−a).(2)
Thus, having a set of 2n−2 numbers that satisfy conditions (1), one can always add numbers an and bn determined by formulas (2). Then a set of 2n numbers satisfies the condition if and only if the signs of the numbers (b−a) and (B−A) are the same.
As an example of the opposite, consider the numbers a1=3,a2=5,b1=2,b2=7. Then a=8,b=9,A=15,B=14. Then a3=B−AB(b−a)=−14,b3=−15. Indeed, the sets of numbers
3; 5; -14 and 2; 7; -15 have the same sums and products, but are constituted by not only positive integers.
The easiest way is to choose numbers such that the first 2n−2 numbers had products differing by 1, i.e. ∣B−A∣=1. Then numbers found by formulas (2) will be integer, and if they satisfy other conditions, they will meet the conditions of the problem. Thus let us find two numbers, each of which has a different decomposition into at least n−1 factors, and which are neighbouring positive integers. As the basis let us choose 2N−1 and 2N.
Let us choose numbers so that:
a1=221−1=3;
a2=221+1=5, then a1a2=222−1;
a3=222+1=17, then a1a2a3=223−1;…
an−2=22n−3+1, then a1a2…an−2=22n−2−1;
an−1=22n−2+1, then a1a2…an−1=22n−1−1;
b1=220=2;
b2=221=4, then b1b2=220+21=222−1;
b3=222=16, then b1b2b3=223−1;…
bn−2=22n−3, then b1b2…bn−2=22n−2−1;
bn−1=22n−2+1, then b1b2…bn−1=22n−1.
Due to the construction we have that b1b2…bn−1=B=22n−1, a1a2…an−1=A=22n−1−1. What is left to check other conditions. B=A+1>A, hence it should be true that b>a.
a=a1+a2+⋯+an−1=221−1+221+1+222+1+⋯+22n−3+1+22n−2+1,
b=b1+b2+⋯+bn−1=220+221+⋯+22n−3+22n−2+1.
b−a=220+221+⋯+22n−3+22n−2+1−221−221−222−⋯−22n−3−22n−2−(n−3)==220−221+22n−2+1−22n−2−(n−3)=22n−2−(n−1)>0
The last inequality can be proved easily by Mathematical Induction.
It remains to check that the numbers are pairwise different. I.e., that the added numbers an and bn do not equal any of the numbers constructed earlier. Provided that B−A=1, we obtain
an=B−AB(b−a)=B(b−a)>bn=B−AA(b−a)=A(b−a)=(22n−1−1)(22n−2−(n−1))>bn−1=22n−2+1>an−1=22n−2+1.
Let us prove that 22n−1−1>22n−2+1, and even a stronger inequality: 22n−1≥22n−2+2. Then we have:
22n−1≥22n−2+2⇔2n−1≥2n−2+2⇔2n−2≥2.
For n=1 it is clear that such numbers do not exist.
For n=2, if a1a2=b1b2=q and a1+a2=b1+b2=p, then the numbers a1,a2 and b1,b2 are the roots of the square equation t2−pt+q=0, and therefore these pairs of numbers are the same up to the order.
Alternative solution.
Suppose we have 2n−2 pairwise different numbers a1,a2,…,an−1, b1,b2,…,bn−1, which satisfy the conditions:
a1+a2+⋯+an−1=a=b1+b2+⋯+bn−1−1,a1a2…an−1=A=b1b2…bn−1−1.(3)
Thus, for the formulas (2) we have b−a=1 and B−A=1, therefore we can make a set of 2n pairwise different numbers a1,a2,…,an−1,an,b1,b2,…,bn−1,bn by adding two numbers obtained by the formulas (2), an=B=A+1 and bn=A.
What is left is to understand how for every positive integer n≥2 obtain two sets of n numbers, sums and products of which differ by 1.
Suppose pairwise different numbers a1,a2,…,an−1,b1,b2,…,bn−1 satisfy conditions (3). Let us add to them numbers: an=A and bn=A−1. Then
a1+a2+⋯+an−1+an=a+A,b1+b2+⋯+bn−1+bn=a+1+A−1=a+A,a1a2…an−1an=AA=A2,b1b2…bn−1bn=(A+1)(A−1)=A2−1.
Now let us add an+1=A2−2 and bn+1=A2−1 to these numbers and obtain:
a1+a2+⋯+an−1+an+an+1=a+A+A2−2,b1+b2+⋯+bn−1+bn+bn+1=a+A+A2−1,a1a2…an−1anan+1=A2⋅(A2−2)=A4−2A2,b1b2…bn−1bnbn+1=(A2−1)(A2−1)=A4−2A2+1.
As you can see, we made sets of 2n+2 pairwise different numbers a1,a2,…,an+1,b1,b2,…,bn+1, that satisfy conditions (3), therefore from them one can obtain the desired sets of 2n+4 numbers. Thus, from the existence of sets satisfying conditions (3) for n=2, we obtain that there are desired sets of numbers for any odd n≥3, and from existence of sets satisfying conditions (3) for n=3 it follows that there are sets for any even n≥4. What is left is to state these numbers.
For n=2 we can take a1=4,a2=5,b1=3,b2=7,
For n=3 we can take a1=2,a2=3,a3=15,b1=1,b2=7,b3=13.
Then, e.g., we make sets as follows:
For n=3: a1=4,a2=5,a3=21 and b1=3,b2=7,b3=20.
With the set for n=2 satisfying conditions (3), we now make a set for n=4 that also satisfies the conditions (3):
a1=4,a2=5,a3=20,a4=398 and b1=3,b2=7,b3=19,b4=399. Then we have thata1+a2+a3+a4=427,b1+b2+b3+b4=428, anda1a2a3a4=159200,b1b2b3b4=159201.