For the following equation:-
$$a_1+a_2+a_3.....+a_n=a_1a_2a_3.....a_n = n$$
For $a_1,a_2...a_n \in \mathbb Z$, find the general form of the integer n.
Note that we need $n$ summands/factors
Note:- Regarding the explanation of the term "general form":
For instance, even numbers are of the general form $2m.$ and rational numbers are of the general form $p/q,etc $. I mean it in that way.
PS: My guess is that we have to use some general formula for multivariable diophantine equation but I don't even know what to do if it is a multivariable diophantine equation.
Systematically considering numbers $n$ from $1$ to $20$ gives the following solutions (written giving product forms only):
$$\begin{align} 1&=1^1\\ 5&=5^1\cdot1^2\cdot(-1)^2\\ 8&=4^1\cdot2^1\cdot1^4\cdot(-1)^2\\ 9&=9^1\cdot1^4\cdot(-1)^4\\ &=3^2\cdot1^5\cdot(-1)^2\\ 12&=3^1\cdot2^2\cdot1^7\cdot(-1)^2\\ 13&=13^1\cdot1^6\cdot(-1)^6\\ 16&=8^1\cdot2^1\cdot1^{10}\cdot(-1)^4\\ &=2^4\cdot1^6\cdot(-1)^6\\ 17&=17^1\cdot1^8\cdot(-1)^8\\ 20&=5^1\cdot2^2\cdot1^{15}\cdot(-1)^4\quad\text{(but see the Remark at bottom)} \end{align}$$
Checking the sequence $1,5,8,9,12,13,16,17,20$ at OEIS leads to the sequence of amenable numbers, which gives a link to a solution by O.P. Lossers in the Math Monthly, April, 1998 (vol. 105, no. 4), pg. 368. Lossers showed that a positive integer $n$ is "amenable" if and only if $n\equiv0,1$ mod $4$ and $n\not=4$.
Here is the gist of Losser's solution (which makes me realize my "systematic" approach overlooked the possibility of negative numbers other than $-1$):
$$\begin{align} 4k+1&=(4k+1)^1\cdot1^{2k}\cdot(-1)^{2k}\\ 8k&=(4k)^1\cdot2^1\cdot1^{6k-2}\cdot(-1)^{2k}\\ 8k+4&=(4k+2)^1\cdot1^{6k+3}\cdot(-1)^{2k-1}\cdot(-2)^1\quad\text{if }k\ge1 \end{align}$$
If $n=4k+2$, then just one factor can be even, so that the other $4k+1$ factors are odd, in which case the sum of the factors is odd, so cannot equal $n$.
If $n=4k-1$, all the factors are odd and an odd number must be congruent to $-1$ mod $4$, leaving the rest congruent to $1$ mod $4$, which leads to a sum congruent to $1$ mod $4$. That is, if $2m-1$ factors are congruent to $-1$ mod $4$, then $n-(2m-1)=4k-2m$ factors are congruent to $1$ mod $4$, so that their sum is congruent to $(4k-2m)(1)+(2m-1)(-1)=4k+1\equiv1$ mod $4$.
Finally, the case $n=4$ (i.e., $8k+4$ with $k=0$, which falls outside the scope of the formula $8k+4=(4k+2)^1\cdot1^{6k+3}\cdot(-1)^{2k-1}\cdot(-2)^1$ because the exponents must all be non-negative) is dispatched by hand.
Remark (added later): In retrospect, I realize I very nearly missed finding the OEIS entry for the amenable numbers, and thus Losser's solution. My "systematic" approach missed the correct factorization $20=10^1\cdot1^{15}\cdot(-1)^3\cdot(-2)^1$, but fortunately found an incorrect one, $5^1\cdot2^2\cdot1^{15}\cdot(-1)^4$, which is incorrect because it has $1+2+15+4=22$ factors, not $20$. Entering just $1,5,8,9,12,13,16,17$ at OEIS, of course, still produces the amenable numbers, but if I'd entered $1,5,8,9,12,13,16,17,21$, instead, I'd have gotten nothing. (On the other hand, I might have still found it and realized I'd overlooked the correct factorization for $n=20$, because when an OEIS search produces nothing, I usually try again with just the first portion of the sequence, on the assumption the smaller numbers are less prone to mistakes on my part.)