Egyptian Fraction
Convert any proper fraction into an Egyptian fraction (sum of distinct unit fractions) using the greedy algorithm. Free online calculator with step-by-step expansion and instant results.
About This Calculator
This Egyptian fraction calculator converts any proper fraction (numerator < denominator) into a sum of distinct unit fractions (fractions with numerator 1) using the greedy algorithm attributed to Fibonacci. The algorithm repeatedly finds the largest unit fraction not exceeding the current remainder and subtracts it until the remainder is zero.
For example, 3/7 expands to 1/3 + 1/11 + 1/231. The algorithm works by taking the ceiling of denominator/numerator as the first unit denominator. This method always terminates and produces a valid Egyptian fraction expansion, though not necessarily the shortest one. The ancient Egyptians used this system for all arithmetic in the Rhind Mathematical Papyrus.
How the algorithm works: Let a/b be the proper fraction. Find the smallest integer n = ceil(b/a). Add 1/n to the expansion. Subtract 1/n from a/b to get the remainder a'/b'. Repeat with a'/b' until a' = 0 or until the expansion exceeds 50 terms (to prevent infinite loops for very large expansions).
Frequently Asked Questions
What is an Egyptian fraction?
An Egyptian fraction is a sum of distinct unit fractions (fractions with numerator 1). For example, 3/7 = 1/3 + 1/11 + 1/231. The ancient Egyptians used this system to represent all rational numbers, and the Rhind Mathematical Papyrus contains tables of such expansions.
How does the greedy algorithm for Egyptian fractions work?
The greedy algorithm finds the largest unit fraction <= the target (ceil(denominator/numerator)), subtracts it, and repeats with the remainder. For example, 3/7: the largest unit fraction <= 3/7 is 1/3 (since ceil(7/3)=3). Subtract: 3/7 - 1/3 = 2/21. Next: 1/11 (ceil(21/2)=11). Continue until the remainder is zero.
Is the Egyptian fraction representation unique?
No, Egyptian fraction representations are not unique. A fraction can have many different expansions. The greedy algorithm always terminates but does not always give the shortest expansion. For example, 5/6 = 1/2 + 1/3 (2 terms) but the greedy algorithm gives 1/2 + 1/4 + 1/12 (3 terms).
What fractions have the shortest Egyptian fraction expansions?
Some fractions have very short expansions: 2/3 = 1/2 + 1/6 (2 terms), 3/4 = 1/2 + 1/4 (2 terms), 4/5 = 1/2 + 1/4 + 1/20 (3 terms). The fraction 1/n is already a unit fraction (1 term). The greedy algorithm can produce surprisingly long expansions for some fractions.
What is the historical significance of Egyptian fractions?
Egyptian fractions date back to the Rhind Mathematical Papyrus (c. 1650 BCE). Ancient Egyptians used only unit fractions, never writing fractions like 2/5 directly. They expressed all fractions as sums of distinct unit fractions. This system influenced later mathematics, including Fibonacci's work on Egyptian fractions in Liber Abaci (1202 CE).
What is a unit fraction?
A unit fraction is a fraction with numerator 1 and a positive integer denominator, written as 1/n. Examples include 1/2, 1/3, 1/4, 1/5, etc. Egyptian fractions require all unit fractions in the expansion to be distinct (no repeated denominators).