PI aproximation with the $ {x\over y^2 } \approx \pi $ pattern

275 Views Asked by At

there are commands in mathematica and maple for finding Rational integer forms that approximate a floating point or a decimal number ...

Mathematica function Rationalize

Maple function convert(float, rational, digits)

simple approximation to pi

but i confused to make an algorithm that find the rationals with the pattern :

$$ {x\over y^2 } \approx \pi $$

for example i saw in a very very old manuscript that mentioned $ {300000\over 309^2} $ is the ratio of circumference of a circle and its diameter !

300000/(309 * 309) = 300000/95481 = 3.14198636377

as you saw these integers contains many zeroes and the number 3 have the main role !

so i am very interested to know how they discovered such ration and i request to help us discover other beautiful integer rationals with such pattern please ?

2

There are 2 best solutions below

3
On BEST ANSWER

Here is some Mathematica code you can execute. It finds the best x/(y^2) approximation for all y's from 1 to ymax, and it prints the best approximation it has seen so far. Set ymax as high as you like and have fun.

ymax = 1000000;
best = 1;
Do[ 
 x = Floor[y*y*Pi + .5];
 approx = x/(y^2); 
 err = Abs[Pi - approx];
 If[err < best,
  best = err;
  Print[x, " / ", y, "^2 = ", approx // N, "  err = ", err // N]],
 {y, 1, ymax}]
4
On

If your question is

When does a circle with integer radius have area that is nearly a round integer?

then here are the best approximations with at least three zeros and $y<10^4$, found with a program:

      x           y     x/y^2           error
   300000        309    3.1419863637792 0.0003937102
   600000        437    3.1418711937540 0.0002785402
   830000        514    3.1416069887508 0.0000143352
  2613000        912    3.1415916435826 0.0000010100
 51352000       4043    3.1415927065030 0.0000000529
 91236000       5389    3.1415926293435 0.0000000242
149138000       6890    3.1415926407300 0.0000000129
233380000       8619    3.1415926636367 0.0000000100
246113000       8851    3.1415926543257 0.0000000007