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)
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 ?