How to do this without calculus:
Your error is that although by taking $n = 1$ you maximize the $a_1$ term that minimizes the exponent. $a = 1000 > b = 500 = 1000/2 > .... k = 1000/n$ but $1000^1 < 500^2 < ..... k^n$.
So while you are correct $a_k = 1000/n$ (or closest integer to it). You haven't any idea what $n$ should be.
Consider a product $a_1a_2....a_n; a_1 + a_2+a_3+.... + a_n = M$.
Our goal is to maximize the product.
1: Unless $M = 1$ (in which case the only product is $1 = a_1 = 1$) none of the $a_k$ will equal $1$.
If you have a term equaling $1$ and another term equaling $a_k$ you can replace these two terms with the single term $b = a_k+1$. This will increase the product (as $a_k + 1 > a_k*1$) while maintaining the sum (as $b = a_k + 1$).
2: There will be no terms larger than 4.
If we have a term $a_k > 4$ we can replace this single term with two terms $b = \lfloor a_k/2 \rfloor$ and $ = \lceil a_k/2 \rceil$. If $a_k$ is even $a = b= a_k/2$. If $a_k$ is odd $a= \frac {a-1}2; b = \frac {a+1}2$.
The sum is maintained ($a + b = a_k$) but the product is increased: if $a_k$ is even then $bc = \frac {a_k}2\frac {a_k}2 = \frac {a_k^2}4 > \frac {a_k*4}4 = a_k$. If $a_k$ is odd then $a_k \ge 5$. Then $bc = \frac {a_k-1}2\frac {a_k+1}2 = \frac {a_k^2 - 1}4 = \frac {a_k^2}4 - 1/4 \ge \frac {a_k*5}4 -1/4 = a_k + \frac {a_k}4- 1/4 > a_k$.
2a: If any of the terms are $a_k =4$ we can replace $a_k$ with two terms, $b = c =2$ with no change to the sum or the product.
3: There will be at most one $4$ or one pair of $2$s.
If there are $a_k = 4$ and $a_j= 4$, we may replace them with $b=3;c=3; d=2$. The sum is preserved as $a_k + a_j = b+c+d$ but the product is increased because $a_k a_j = 16$ while $bcd = 18 > 16 = a_ka_j$.
If there are $a_k =2; a_j = 2; a_l =2$ we may replace them with $b=c= 3$. The sum is preserved as $a_k + a_j + a_l= a+b$, but the product is increased because $a_k a_j a_l= < 8 < 9 = bc$.
Putting all those facts together we realize the terms must be either a) all $3$s (in which case $M$ is a multiple of $3$). b) all $3$s and one $2$ (in which case $M \equiv 2 \mod 3$) or c) all $3$s and two $2$s or alternatively all $3$ and one $4$ (in which case $M \equiv 1 \mod 3$).
So if $M = 1000= 3*332 + 4$, the highest possible product is $n = 333$ or $n= 334$ with $a_1$ through $a_{332} = 3$ and either $a_{333}=4$ or $a_{333}=a_{334} = 2$.
==== old answer (same idea but I think if modified significantly to warrant my current answer as different) ====
How to do this without calculus:
Let $a_1a_2.....a_n$ be the largest product.
If $a_i = 4$ you could replace $a_i =4$ with $a_{i1} =2; a_{i2} = 2$ and$a_i = a_{i1}+a_{i2}; a_i = a_{i1}a_{i2}$ with no change in the product.
If $a_i > 4$ you could replace $a_i=4$ with $a_{i1} = (a_i - 2); a_{i2} = 2$ to get $a_{i1}a_{i2} = 2a_i - 4 = a_i + (a_i -4) > a_i$ while $a_i = a_{i1}+a_{i2}$. So this will make the product bigger.
So the maximum product need not contain anything larger than $3$.
If the product contains any $a_i = 1$ and some $a_j$, then replacing both of those with $a_k = a_j + 1$ will make the product bigger as $a_j + 1 > a_j*1$.
So the list of terms will contain only $3$s and $2$s.
The question becomes how many threes and how many $2$s.
Well. Any three $2$s, $2*2*2=8$, can be replaced with $3*3 = 9$ while $2+2+2 = 3+3$. So there will be at most two $2$s. The rest will be $3$s.
If $k=1000$ is divisible by $3$ they will all be $3$. (It isn't and they aren't.)
If $k = 1000$ has remainder two when divided by $3$ there will be one $2$. (Ditto.)
If $k = 1000$ has remainder one when divided by $3$ (it does) there will be two $2$s.
So the maximum product is $2^2* 3^{m}$ where $m = \frac {1000 - 2-2}3 = 332$.