# Help finding the formula for this sequence {$23$, $114$, $187$, $473$, $2792$, $5624$, $19640$, $75884$, $187211$, $479798$, $1452835$, $5102237$…}

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

$$\{23,114,187,473,2792,5624,19640,75884,187211,479797,1452795,5102858,14872865,72392867,146262888\}$$

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
n=23
digit=0
while(True):
strpi=str(pi)
count1=2
while(count1<len(strpi)-1):
if(strpi[count1]==str(math.pi)[count1]):
if(digit<count1):
print(n,"\n\n",pi,"\n")
digit=count1
else:
break
count1+=1
n+=1

• 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

• Here is a GIF showing the increase of numbers as $$n$$ increases
• 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. – Jean-Claude Arbaut Dec 15 '18 at 15:47
• This is in degrees. I'll add this in – yolo Dec 15 '18 at 15:48
• Maybe I'm wrong, but I highly doubt you're going to find a formula for this. – Matt Samuel Dec 15 '18 at 15:58
• 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. – Jean-Claude Arbaut Dec 15 '18 at 15:58
• A pi on both sides of the equation? $π=\frac{n}{2} × sin(\frac{2π}{n})$ – 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
• Are you saying the pattern is roughly $n^3* root 10$? – yolo Dec 16 '18 at 10:56
• 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}$ – Ross Millikan Dec 16 '18 at 15:29
• 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. – yolo Dec 16 '18 at 16:17