A spiralling sequence based on integer divisors. Has anyone noticed this before?
Solution 1:
For the first question: You may be able to find some similar results on exponential sums in the book "Ten Lectures on the Interface Between Analytic Number Theory and Harmonic Analysis," by Montgomery. Also, Noam Elkies has a similar picture in part of his analytic number theory course.
For the second question: "Why do the whirlpools occur where they do?" Let us first simplify the problem a little: to avoid confusion regarding which root to use in the definition of $a_n$, take $a_n=\prod_{j=1}^n e^{2\pi i(n\pmod{j})/j}$ Now, observe that: $a_{n+1}=a_n\cdot e^{\frac{2\pi i n}{n+1}}\cdot\prod_{j=1}^{n+1}e^{2\pi i/j}=a_n\cdot e^{\frac{-2\pi i }{n+1}}\cdot\prod_{j=1}^{n+1}e^{2\pi i/j}$ (if you would like me to write out a proof of this 'observation,' leave a comment, and I'll add one). Then, by induction and the fact that $a_1=1$, we obtain the explicit formula: $a_n=\prod_{m=0}^{n-2}\prod_{j=1}^{m+1}e^{\frac{2\pi i}{j}}$, which we can simplify down to: $$a_n=\exp(2\pi i nH_n)$$ where $H_n=\sum_{j=1}^n\frac{1}{j}$. Then we may compute $a_{n+1}-a_n=\exp(2\pi i(n+1)(\frac{1}{n+1}+H_n)-\exp(2\pi inH_n)$ $=\exp(2\pi inH_n)\exp(2\pi iH_n)-\exp(2\pi inH_n)=a_n(\exp(2\pi i H_n)-1)$
Note that a whirlpool will correspond to the smallest possible change $|a_{n+1}-a_n|$: we are looking for places where adding consecutive terms does not change things by very much. So, using the approximation $H_n\approx \log n+\gamma$ helpfully pointed out by Marc Paul in the comments above, we get that the local minimums of $|a_{n+1}-a_n|$ should occur near $\exp(2\pi i (\log(x)+\gamma))=1$ i.e. when $\log(x)+\gamma=n$ for some integer $n$, and this occurs exactly when $x=e^{n-\gamma}$. This is because then $|a_{n+1}-a_n|\approx 0$ will be as close to $0$ as possible. Similarly, the "maximum flows" should be near where $\exp(2\pi i(\log(x)+\gamma))=-1$, i.e. near $x=e^{n-\gamma+.5}$, because this is where $|a_{n+1}-a_n|\approx 2$, which is the maximum possible value.
Warning: there is a little unfinished business ahead in the answer to your third question, "Is every term of $a_n$ unique?" In short, no. $a_1=1=a_2$. However, in general if $a_n=a_m$ with $n>m$, then using our formula for $a_n$, we have $\exp(2\pi inH_n)=\exp(2\pi imH_m)$ which implies $2\pi inH_n-2\pi imH_m=2\pi i k$ for some integer $k$. Then we have: $$\sum\limits_{j=1}^m\frac{n-m}{j}+\sum\limits_{j=m+1}^n\frac{n}{j}=k$$ which I suspect has no solutions other than $n=2$, $m=1$, $k=2$, but which remains to be proved.