Clearly, $$\sum_{n=1}^\infty \frac 1{\sin(n)}$$ Does not converge (rational approximations for $\pi$ and whatnot.) For fun, I plotted $$P(x)=\sum_{n=1}^x \frac 1{\sin(n)}$$ For $x$ on various intervals. At first, I saw what you might expect:

enter image description here

enter image description here

Which is $P(x)$ for $x \in [0,20]$ and then $[0,300]$. Seems a little self-similar, but whatever. Then I looked at $P(x)$ on the interval $[360,700]$:

enter image description here

OK, that looks suspiciously like $P(x)$ on the interval $[0,300]$, but I'll toss out this coincidence as 'probably has to do with $\pi$ being irrational.' Here is $P(x)$ on $[700,1050]$:

enter image description here

And I observe similar behavior on similar intervals.

Putting it all together, here is $P(x)$ on $[0,20000]$:

enter image description here

It's converging? Not quite. Here is $P(x)$ on $[20000,100000]$:

enter image description here

So again, we're seeing the function 'get closer and closer, then get farther and farther, all while alternating' from some value, just as we saw on the smaller intervals. I suspect that if my computer could handle $P(x)$ on $[100000,200000]$, we would see the same thing (on a larger scale), though I'm not sure.

So: what's going on here? How can we explain this fractal-ish behavior?

Edit: I wonder if $P:\mathbb{N} \to \mathbb{R}$ is injective...

  • 4
    I guess I wouldn't be shocked that reciprocating a periodic function which is often close to $0$ would do this. Maybe I'm not seeing it. – Randall Jan 23 '20 at 17:13
  • 1
    Could you explain what you mean by "rational approximations for $\pi$ and whatnot"? – clathratus Jan 23 '20 at 17:14
  • @clathratus integers $n$ can get arbitrarily close to some integer (and trivially, rational) multiples of $\pi$, and if some integer is close to an integer multiple of $\pi$, its corresponding term in our sum becomes arbitrarily large, and so the terms in our sum are not bounded and hence it does not converge. – Descartes Before the Horse Jan 23 '20 at 17:18
  • @clathratus Infinitely many coprime pairs $(p,\,q)\in\Bbb N^2$ satisfy $|\pi-p/q|<1/(q^2\sqrt{5})$, so $|1/\sin p|>q\sqrt{5}$. – J.G. Jan 23 '20 at 17:20
  • I can see that it also tends to go more and more negative ... up to $n=100,000$. Does it become positive again? Infinitely many times? – Stinking Bishop Jan 23 '20 at 17:22
  • @StinkingBishop almost definitely. – Descartes Before the Horse Jan 23 '20 at 17:23
  • 11
    I haven't pieced together the details yet, but I'm going to say about 75% that this has to do with rational approximations to $\pi$ and what amount to 'harmonics' in the sum where e.g. the fact that you have peaks every sixth $n$ in the early range is related to the fact that $2\pi\approx 6$ so that $1/\sin(n+6)\approx 1/\sin(n)$. Similarly, the wavefronts for $n\lt 1000$ are almost certainly spaced 44 units apart corresponding to $14\pi\approx 44$. I wouldn't be surprised if there's some very clever Fourier-esque transform that makes this explicit. – Steven Stadnicki Jan 23 '20 at 21:41
  • 11
    You get a huge jump when $n$ is the numerator of a convergent of $\pi$. In between two such numerators, you get something close to "periodic" behaviour with smaller jumps from earlier convergents. It's a pity that between your second and third plots you skipped the two large jumps close together from $333$ and $355$. – Daniel Fischer Jan 23 '20 at 21:54
  • biggest jump among $[1, 100]$ is at 22; $\pi \approx 22/7$, so $22 \approx 7\pi$. It is the 'best' approximation from the continued fraction of $\pi$. The next best approximation obtained from the continued fraction is $355/113$ and there is also a big jump at $355$. I think you will see a next big jump at 103993. – dust05 May 30 '20 at 05:04

2 Answers2


The comments are well illustrating what's going on here. I'm writing the post to insert images and add a little explanation on continued fraction approximation.

As i mentioned above at comment, the 'best' rational approximations of irrational number come from its continued fraction. First rational approximations are $$3, \frac{22}{7}, \frac{333}{106}, \frac{355}{113}, \frac{103993}{33102}, \frac{104348}{33215}, \frac{208341}{66317}, \frac{312689}{99532}, \cdots .$$ (Mathematica code is like Table[FromContinuedFraction[ContinuedFraction[Pi, k]], {k, 1, 20}])

At a good approximation of $\pi$, say $355/113$, we have $355 \approx 113 \pi$ so $\sin (355) \approx 0$. Further the difference is estimated as \begin{align*}|\sin(355)|& = |\sin(355 - 113\pi)|= 113\cdot \sin\left|\frac{355}{113} - \pi\right| & \\ & < 113 \cdot\left|\frac{355}{113} - \pi\right| < 113 \cdot \frac{1}{113 \cdot 33102} = \frac{1}{33102}\end{align*} so $|\sin(355)|>33102$, so the jump at 355 is bigger than 30000.

enter image description here

(You see a jump at 710, which is $355\times 2$. Note that $\pi \approx 355/113 = 710/226$)

You have next continued fraction estimatation 103993/33102, i.e so there is a jump at 103993. The size of this jump is similarly estimated as $>33215$.

enter image description here

Then the next jump is quite close since the next continued fraction estimation is 104348/33215, with jump is greater than 66317. enter image description here

This pattern, big jumps at numerator of continued fraction estimation of $\pi$ continues as follows.

enter image description here

If you are interested in python3 code:

import numpy as np 
from matplotlib import pyplot as plt 

reciprocal_sin_sum = [0] 
for n in range(1, 400000):
    reciprocal_sin_sum.append(reciprocal_sin_sum[-1] + 1/(np.math.sin(n)))

plt.plot(range(len(reciprocal_sin_sum)), reciprocal_sin_sum)
  • 2,189
  • 11
  • 20

Just for fun we could construct an integral representation of the sum: The inverse Mellin transform of $1/\sin(n)$ is $$ \mathcal{M}^{-1}\left[\frac{1}{\sin(n)}\right](x) = \frac{1}{1+x^\pi} $$ which perhaps shows the relationship to $\pi$ more clearly. Then we can formally write $$ \int_0^\infty \left(\sum_{k=0}^n x^k \right)\frac{1}{1+x^\pi} \; dx = \sum_{n=1}^{n+1} \frac{1}{\sin(n)} $$ or $$ \int_0^\infty \frac{(x^{n+1}-1)}{(x-1)(1+x^\pi)} \; dx = \sum_{n=1}^{n+1} \frac{1}{\sin(n)} $$ which apparently works for integer $n$. Now we can also numerically interpolate for some fractional $n$ such as $n=1/2$, although I can't vouch for the correctness of this continuation... This leads to a guess of the infinite limit of $$ \int_0^\infty \frac{1}{(1-x)(1+x^\pi)} \; dx = \sum_{n=1}^{\infty} \frac{1}{\sin(n)} \approx 1.256628 $$ although I'm not sure if the numeric integration just spat out some nonsense there... The residue at $x=1$ appears to be $-1/2$.

Benedict W. J. Irwin
  • 3,881
  • 13
  • 42