Excuse the large title (The 'good title' page said not to be afraid to make it too long)


I'm trying to figure out the nth term for these numbers. To help:

  • I'm generating these numbers on a python program:

    import math
  • For the non-programmers the program uses this formula:

    $ π=n \cdot \sin(\frac{90n-180}{n}) \cdot \sin(\frac{180}{n})$

    What this does is calculate $\pi$ more accurately the higher the value of $n$. The program recorded the value of $n$ each time the next decimal value of $\pi$ was found (increasing $n$ by $1$ starting from $0$ each time). So if $n$ is $23$ the output is $3.1$ and if it is $114$ the value is is $3.14$. Note that these values have decimal places after them that are not digits of $\pi$. And this is in degrees, not radians.

  • This formula is derived from this one (Done with the sine rule):

    $ A=nr^2 \cdot \sin(\frac{90n-180}{n}) \cdot \sin(\frac{180}{n})$

    $A=$ The area of a proper polygon, $r=$ length from centre to corner, $n=$ number of sides

I substituted $A$ with $πr^2$ and simplified

  • It took me a while to realise that the difference between the first two values is larger than the difference between the second and third ($91$ then $73$)

  • If my program gets a new value I'll be adding it in. And if you want me to create an algorithm to find different data relating to this to help you solve it, or have an improved program do not hesitate to ask/suggest.

  • Technically speaking, the first element could be labelled as $12$ which gives the first digit as $3$.

  • Below are the pi values given when n is increased

enter image description here

  • Here is a GIF showing the increase of numbers as $n$ increases enter image description here
  • 3
    $\begingroup$ In radians and after simplification, you compute $\frac n2\sin \frac{2\pi}{n}$. It's half the perimeter of a polygon with $n/2$ sides. $\endgroup$ – Jean-Claude Arbaut Dec 15 '18 at 15:47
  • $\begingroup$ This is in degrees. I'll add this in $\endgroup$ – yolo Dec 15 '18 at 15:48
  • $\begingroup$ Maybe I'm wrong, but I highly doubt you're going to find a formula for this. $\endgroup$ – Matt Samuel Dec 15 '18 at 15:58
  • 1
    $\begingroup$ Of course it's in degrees, that's why I translated this to radians. Degrees are useless when you want to use some calculus, and with calculus you get pretty easily that $\frac n2 \sin \frac{2\pi}{n}\to\pi$ as $n\to\infty$, albeit very slowly. That's basically the method used by Archimedes to get his approximation $\frac{22}7$. You could find an asymptotic approximation for your integer sequence, but like @MattSamuel I don't think there is a simple closed form. $\endgroup$ – Jean-Claude Arbaut Dec 15 '18 at 15:58
  • $\begingroup$ A pi on both sides of the equation? $π=\frac{n}{2} × sin(\frac{2π}{n})$ $\endgroup$ – yolo Dec 15 '18 at 16:02

As Jean-Claude Arbaut says, you are approximating $\pi$ with $\frac n2\sin \frac {2\pi}n$. For $n$ large the argument of $\sin$ is small and we can use the Taylor series. You are then computing $\pi-\frac n{12}\left(\frac {2\pi}n\right)^3+O(\frac 1{n^4})$ The alternating series theorem says that the error of truncation is of the same sign as the first ignored term and smaller than it. You are looking for the times when the error gets smaller than the digits of $\pi$ starting somewhere. For your first example, you need the error to be less than $0.04159265\ldots$. The small gap between $114$ and $187$ comes because that digit of $\pi$ is $1$. I am sure there is no easy way to compute the exact terms because they depend on the remainder after some number of digits, which can vary over a wide range. We can ask when $\frac n{12}\left(\frac {2\pi}n\right)^3 \lt 10^{-k}$, which comes when $n\gt \left(\frac{12\cdot 10^k}{8\pi^3}\right)^{1/3}$ and we would expect terms to be roughly multiplied by $\sqrt {10} \approx 3.162$

Added: I plotted $n$, the number of correct decimals, vs $\log_{10}a(n)$ where $a(n)$ is the $n^{th}$ term from the sequence above. It forms a reasonable straight line with formula $\log_{10}a(n)\approx 0.9225+0.4806n$. I suspect with more terms in the sequence it would converge on $\log_{10}a(n)=1+\frac n2$ A plot is below enter image description here

  • $\begingroup$ Are you saying the pattern is roughly $n^3* root 10$? $\endgroup$ – yolo Dec 16 '18 at 10:56
  • $\begingroup$ I plotted the number of decimals against the base $10$ log of the numbers in your series. The fit came out $0.9226+0.4806n$, so it goes up close to $\sqrt {10}$ each time (the coefficient would be $0.5$). It is about $10^{1+\frac n2}$ $\endgroup$ – Ross Millikan Dec 16 '18 at 15:29
  • $\begingroup$ Can you get any closer? $\endgroup$ – yolo Dec 16 '18 at 16:05
  • $\begingroup$ I am sure with much more data the formula would converge on exactly what I gave. As I said, there is a fair amount of noise in the data because the remaining digits can vary so much. $\endgroup$ – Ross Millikan Dec 16 '18 at 16:13
  • $\begingroup$ probably shoulda mentioned this in the OP in the first place: but there seems to be some sort of pattern each time $n$ increases. Look at the pi values. They seem to have 5 extra 0s after diverging from pi. I'll post it. $\endgroup$ – yolo Dec 16 '18 at 16:17

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.