Find unknown factor in series so it converges to a given value I'm trying to find $F(z)$ such that:
$$\lim_{N \to\infty} \sum_{n=1}^N F\left(\exp\bigg(\frac{2 \pi i n}{N}\bigg)\right) \cdot \log\left|\exp\bigg(\frac{2 \pi i n}{N}\bigg) - \exp(i \theta)\right| = \\\log|a \exp(i \phi) - \exp(i \theta)| $$
where $a \in (0, 1)$ is fixed.
I thought I could express this as an integral:
$$\begin{matrix}\displaystyle
\int_0^{2\pi} F\big(\exp(it)\big) \log|\exp(it) - \exp(i \theta)| dt &= \log|a \exp(i \phi) - \exp(i \theta)| \\
\displaystyle\oint F(z) \log|z - \exp(i \theta)| \frac{dz}{iz} &= \log|a \exp(i \phi) - \exp(i \theta)| \\
\end{matrix}$$
in which case
$$F(z) = \frac{1}{2 \pi} \frac{z}{(z - a \exp(i \phi))}$$
However when I plug in this $F(z)$ and do some example partial sums I get values which are not close to the expected values and are not even off by a constant factor, which makes me think I've screwed something up.
 A: The solution concerns for the case when the sum is equal to zero.
$\lim\limits_{N \to\infty} \sum\limits_{n=1}^N F\left(e^{\frac{2 \pi i n}{N}}\right) \cdot \ln\left|e^{\frac{2 \pi i n}{N}} - e^{i \theta}\right| = \ln|a e^{i \phi} - e^{i \theta}|$
Let's transform the $\ln$ part of LHS:
$\ln\left|e^{\frac{2 \pi i n}{N}} - e^{i \theta}\right|=\overbrace{\ln|e^{\frac{\pi i n}{N}-\frac{i\theta}{2}}|}^0+\ln|\overbrace{e^{\frac{\pi i n}{N}-\frac{i\theta}{2}}-e^{-\frac{\pi i n}{N}+\frac{i\theta}{2}}}^{2i\sin(\frac{\pi n}{N}-\frac{\theta}{2})} |$
Let  $F=\frac{1}{N}F^*$ we have the following Riemann sum:
$\lim\limits_{N \to\infty} \frac{1}{N}\sum\limits_{n=1}^N F^*\left(e^{\frac{2 \pi i n}{N}}\right)\ln|{2\sin(\frac{\pi n}{N}-\frac{\theta}{2})}|=\int\limits_0^1F^*\left(e^{2 \pi i x}\right)\ln|{2\sin(\pi x-\frac{\theta}{2})}|dx$
Using that $\int f'(x) f(x)dx=\frac{1}{2}f^2(x)+c$
$f(x)=\ln|{2\sin(\pi x-\frac{\theta}{2})}|$
$f'(x)=F^*(e^{2 \pi i x})=\pi |\cot(\pi x-\frac{\theta}{2})|$
We get:
$\int\limits_0^1\pi |\cot(\pi x-\frac{\theta}{2})|\ln|{2\sin(\pi x-\frac{\theta}{2})}|=\frac{1}{2}\ln^2|{2\sin(\pi x-\frac{\theta}{2})}|\Big|_0^1=0$
So  $\ln|a e^{i \phi} - e^{i \theta}|$ must be equal to $0$.
$a(a-2\cos(\theta-\phi))=0$
As $a \in (0, 1)\rightarrow$ $a=2\cos(\theta-\phi)$
Finally $\theta=\cos^{-1}(\frac{a}{2})+\phi$
