# Express Integer as Product Complex Number

Given positive integer $$n$$. Find all integers can be expressed as $$S=\left (\sum_{k=1}^nz_k\right )\left (\sum_{k=1}^n \frac{1}{z_k}\right )$$ for some complex number $$z_1,\cdots,z_n$$ and $$|z_1|=\cdots|z_n|=1$$.

Here is my approach. For $$n=1$$ it's trivial. For $$n\ge 2$$, let $$z_k=e^{it_k}$$ where $$0. I have prove that $$0\le S\le n^2$$ and $$S = \left (\sum_{k=1}^n \cos(t_k)\right )^2 + \left (\sum_{k=1}^n \sin(t_k)\right )^2.$$ I have found that for perfect square numbers. For example, if $$n=2k$$ for $$k$$ positive integer:

• $$t_1=t_2=\cdots=t_n=0\implies S=4k^2.$$
• $$t_1=t_2=\cdots=t_x=0$$ and $$t_{x+1}=\cdots=t_{2k}=\pi$$ $$\implies S=0$$.
• $$t_1=t_2=\cdots=t_x=0$$ and $$t_{x+1}=\cdots=t_{2k}=\pi$$ $$\implies S=(2k-2x)^2$$.
• $$t_1=t_2=\cdots=t_{2x}=0$$ and $$\left (t_{2x+1},t_{2x+2},t_{2x+3},t_{2x+4},\cdots,t_{2k-1},t_{2k}\right )=\left (\frac{\pi}{2},-\frac{\pi}{2},\frac{\pi}{2},-\frac{\pi}{2},\cdots, \frac{\pi}{2},-\frac{\pi}{2}\right ),$$ we have $$S=(2x-1)^2$$.

For the rest number I don't have any clue to make construction.

• What does $\displaystyle\left (\sum_{k=1}^n\right )\left (\sum_{k=1}^n \frac{1}{z_k}\right )$ mean? Apr 3 at 9:20
• My mistake, now it has been edited Apr 3 at 9:49
• Note that $\left (\sum_{k=1}^n z_k\right )\left (\sum_{k=1}^n 1/z_k\right ) = n+\sum_{1\le p<q\le n} \left (z_p\overline{z_q} + \overline{z_p}\overline{z_q}\right )=n + 2\sum_{1\le p<q\le n}\cos t_p\cos t_q + \sin t_p\sin t_q$. Apr 3 at 11:05
• @AnneBauval $(\sum_{k=1}^n \cos(t_k))^2=\sum_{k=1}^n \cos^2 t_k+2\sum_{1\le p<q\le n} \cos t_p \cos t_q$. Similar for $\sin$. Apr 3 at 11:59
• Of course, so what? I mean, what allows you to write $S = \left (\sum_{k=1}^n \cos(t_k)\right )^2 + \left (\sum_{k=1}^n \sin(t_k)\right )^2$? And to claim "I have prove that"? Apr 3 at 12:01

If $$n$$ is even, by taking have of $$t_k$$s equal to $$\pi$$ and the other half to $$0$$, we get that $$\left (\sum_{k=1}^n \cos(t_k)\right )^2 + \left (\sum_{k=1}^n \sin(t_k)\right)^2$$ equals zero. On the other hand, if all $$t_k\equiv 0$$, we get $$n^2$$. Since $$S$$ depends continuously on $$t$$s, we can thus get all numbers in $$[0,n^2]$$.

If $$n\ge 3$$ is odd, choose $$t_1=\frac\pi 3$$, $$t_2=-\frac\pi 3$$, $$t_3=\pi$$ and then the remaining (even number of) $$t_k$$s alternating $$\pi$$ and $$0$$. Then $$S=0$$. By the same reason, $$S$$ also takes all real numbers in $$[0,n^2]$$, $$n^2+1$$ of which are integers.

Finally, if $$n=1$$ the answer is clear (1).

• Nice. I only wish to add that for this it is crucial that $S(t_1,\ldots,t_n)$ is always a real value. This not immediately obvious if we look at the first OP equation, but it becomes so with the equivalent $\cos$ and $\sin$ equation. If $S$ also took complex values, we could not apply the intermediate values property.
– chi
Apr 3 at 19:49
• Great answer! I was so focused on finding a construction whose result was an integer that I forgot about its continuity. Apr 3 at 19:57

Here's an explicit construction for all real $$0\leq m\leq n^2$$, $$n\geq 2$$.

If $$n=2k + l$$, $$l\in\{0,1\}$$, there exists a triangle with sides $$(k,k+l,\sqrt{m})$$ provided that $$l\leq m \leq n^2$$ (and allowing degenerate triangles). Let $$\phi$$ be the measure of the angle opposite the side of length $$\sqrt{m}$$ as determined by the law of cosines. Let

$$z_i=\begin{cases} 1 & 1 \leq i \leq k+l\\ -e^{-i\phi} & k+l+1 \leq i \leq n \end{cases}\text{.}$$ Then $$\lvert\sum_iz_i\rvert^2 = m$$.

In particular, there exists a triangle with sides $$(1,1,\sqrt{m}+1)$$ provided that $$0\leq m \leq 1$$. Let $$\phi$$ be the measure of the angle opposite the side of length $$\sqrt{m}+1$$. Let $$\psi$$ be the measure of one of the other angles. Let $$n\geq 3$$ be odd, and let

$$z_i=\begin{cases} 1 & i=1\\ -e^{-i\phi} & i=2\\ -e^{i\psi} & i =3\\ (-1)^i & i >3 \end{cases}\text{.}$$ Then $$\lvert\sum_iz_i\rvert^2 = m$$.