Closed Form of the Real Portion of $f(n) = \prod_{m=2}^{n-1} e^{\pi i n/m}$ I am wondering if it is possible to express an equation in closed form.  I currently have:
$$f(n) = \prod_{m=2}^{n-1} e^{\pi i n/m}$$
Where $i$ is the $\sqrt{-1}$, which I know it commonly represents but due to the finite product I figured I would add this note for clarity.
Context: I am trying to work towards a solution for Simplify Product of sines, yet so far I have only arrived here.
Some options I have been considering to try and find a closed form include cases such as I only actually care when $n$ is an odd number so discarding even cases is fine if that simplifies it.  I am also fine with having the series start a $m=1$ instead of $m=2$ if that somehow simplifies the answer.  The other potential saving grace is that I may only care about the real portion of the answer and not the imaginary portion if that simplifies things.
Sorry I am a computer scientist not a mathematician so please  let me know if I should adjust the title or the wording of the question for clarity.  Any leads or help of any form would be appreciated as I am currently lost.
 A: $$
\begin{align}
\prod_{m=2}^{n-1}e^{\frac{\pi in}m}
&=e^{\pi in(H_{n-1}-1)}\\
&=(-1)^ne^{\pi inH_{n-1}}\\[9pt]
&=(-1)^{n-1}e^{\pi inH_n}\tag1
\end{align}
$$
where $H_n$ is the $n^\text{th}$ Harmonic Number.
$$
H_n\sim\log(n)+\gamma+\frac1{2n}-\frac1{12n^2}+\frac1{120n^4}-\frac1{252n^6}+\frac1{240n^8}-\frac1{132n^{10}}\tag2
$$
and $\gamma$ is the Euler-Mascheroni constant.
The real portion of $(1)$ is
$$
\operatorname{Re}\left(\prod_{m=2}^{n-1}e^{\frac{\pi in}m}\right)=(-1)^{n-1}\cos\left(\pi nH_n\right)\tag3
$$
A: $$\begin{align}
f(n)=&\prod_{m=2}^{n-1}\exp\frac{i\pi n}{m}\\
&=\exp\left[\sum_{m=2}^{n-1}\frac{i\pi n}{m}\right]\\
&=\exp\left[i\pi n\sum_{m=2}^{n-1}\frac{1}{m}\right]\\
\end{align}$$
Recalling the definition of the harmonic numbers:
$$H_n=\sum_{m=1}^n\frac1m$$
We have that 
$$f(n)=\exp\left[i\pi n(H_{n-1}-1)\right]$$
Then using $e^{i\theta}=\cos\theta+i\sin\theta$,
$$f(n)=\cos\left[\pi n(H_{n-1}-1)\right]+i\sin\left[\pi n(H_{n-1}-1)\right]$$
So 
$$\text{Re}f(n)=\cos\left[\pi n(H_{n-1}-1)\right]$$
