Solution:
Let x1+x2+⋯+xk=2004, x1,x2,…,xk∈N, x1<x2<⋯<xk and the product x1x2…xk is maximal. Assume that for some i,j, 1≤i<j≤k one has that xi≤xi+1−2 and xj≤xj+1−2. Then replacing xi and xj by xi+1 and xj−1, respectively (the sum is the same, i.e. 2004), we get a larger product since
(xi+1)(xj−1)=xixj+xj−xi−1>xixj
a contradiction. Hence x1,x2,…,xk are consecutive integers but at most one.
Let the numbers be {x1,x2,…,xk}={x,x+1,…,x+ℓ,x+ℓ+n,x+ℓ+n+1,…,x+k+n−2} and k=n+ℓ−2. If n≥3, we replace x+ℓ and x+ℓ+n by x+ℓ+1 and x+ℓ+n−1, respectively, and, as above, we get a larger product.
Let n=1 and the numbers be x,x+1,…,x+k−1. If x≥5 we replace x by the numbers x−2 and 2. The sum remains 2004 and the product increases, since 2(x−2)>x. If 1≤x≤4, a direct verification shows that either we have a larger product or the sum is not equal to 2004 (for x=2 and x=3).
It remains to consider the case n=2. Let the numbers be
x,x+1,…,x+ℓ,x+ℓ+2,x+ℓ+3,…,x+k,ℓ≥0,k≥ℓ+2
As above, we get a larger product for x=1 and x≥4.
If x=2, then 2+3+⋯+(ℓ+2)+(ℓ+4)+⋯+(k+2)=2004 and hence (k+2)(k+3)=2(2008+ℓ). Since 0≤ℓ≤k−2, it follows that 4016≤(k+2)(k+3)≤4012+2k and then k=61,ℓ=8. So the numbers are 2,3,…,10,12,13,…,63 with product 1163!.
For x=3 we get analogously k=60,ℓ=5 and the numbers are 3,4,…,8,10,11,…,63 with product 1863! which is smaller than 1163!.