University · Number Theory
Round 1/6Score 0

Fraction Finder

Follow integer divisions, track rational errors and navigate the fraction tree.

Rational laboratory

a/b c/d M

A mediant adds the two numerators and the two denominators, then reduces the result.

Your construction

Rational approximation error

Orange: best error up to q · Blue: convergent · Pink: your fraction

Fraction-tree path

The maths

A rational continued fraction is produced by repeated division with a non-negative remainder. Each prefix gives a convergent p/q.

The best bounded-denominator approximation minimises |x − p/q| for 1 ≤ q ≤ Q. Convergents and certain intermediate fractions provide particularly good approximations.

The continued fraction for a non-square positive integer's square root has a periodic tail. A greedy Egyptian expansion repeatedly subtracts the largest unit fraction no greater than the remainder.

A mediant is (a+c)/(b+d). In the Stern–Brocot tree, left and right choices successively narrow the interval containing a positive rational target.