Egyptian Fraction Decomposer

Enter a numerator and denominator of a proper fraction.

How it is calculated

The tool uses the greedy method. The fraction is first reduced by the greatest common divisor, so 2/4 is treated as 1/2. For the remaining fraction a/b it takes the largest unit fraction that does not exceed it, 1/x with x = ceil(b ÷ a). That unit fraction is subtracted, a/b − 1/x = (a×x − b) / (b×x), the new fraction is reduced, and the process repeats until nothing remains. The unit fractions found are distinct and listed in order, together with the number of terms. Numerator and denominator must be whole numbers with 0 < numerator < denominator; 3/2, 5/5, 0/5 and 2.5/7 give no result. The method always ends, but the answer is not guaranteed to have the fewest terms. Denominators can grow very fast, and when the next denominator would no longer fit in a 64-bit whole number (5/121 is one such case) the tool shows no result rather than a wrong one.

Worked example

Decompose 4/13. First ceil(13 ÷ 4) = 4, so take 1/4: 4/13 − 1/4 = (16 − 13)/52 = 3/52. Next ceil(52 ÷ 3) = 18, so take 1/18: 3/52 − 1/18 = (54 − 52)/936 = 2/936 = 1/468. What remains is already a unit fraction. The tool lists 1/4 + 1/18 + 1/468 and counts 3 terms. Adding them back over the common denominator 468 gives 117 + 26 + 1 = 144 over 468, which reduces to 4/13.

Try this example →

Common mistakes

  • Entering an improper fraction or a mixed number such as 7/4 or 1 3/4. Only fractions below 1 are accepted, so split off the whole part and decompose the remainder.
  • Entering a decimal numerator or denominator, such as 2.5/7. Both must be whole numbers; multiply top and bottom by 10 first (25/70).
  • Expecting the shortest or neatest decomposition. The greedy answer for 6/7 is 1/2 + 1/3 + 1/42, but for other fractions it produces long chains with huge denominators where a hand-picked answer is much shorter.
  • Believing the result is the only Egyptian fraction. Many fractions have several valid decompositions, and the tool shows just the greedy one.
  • Trying fractions like 5/121 and reading the empty result as invalid input. The fraction is fine; the greedy denominators simply outgrow what the tool can compute exactly.

About this calculator

An Egyptian fraction expresses a proper fraction as a sum of distinct unit fractions — fractions with numerator 1, like 1/2 + 1/3 + 1/10 — the form ancient Egyptian mathematicians used (as recorded in documents like the Rhind Mathematical Papyrus) since their numeral system had no convenient way to write general fractions such as 2/5.

This decomposer uses the greedy algorithm, sometimes called the Fibonacci–Sylvester method after Fibonacci's 13th-century description and Sylvester's 19th-century proof that it always terminates: at each step it subtracts the largest unit fraction not exceeding the remaining value, then repeats on the remainder. The result is always a finite sum of distinct unit fractions, though not necessarily the shortest one possible — a genuinely open problem for some fractions is finding the minimum number of terms.

Was this helpful?

You can pick up to 3 reactions.

Comments (1)

  • Editorial team

    The greedy answer is correct but rarely the tidiest, so treat it as one valid decomposition rather than the only one. Try 2/5, which comes out as 1/3 + 1/15, then 6/7, which gives 1/2 + 1/3 + 1/42. Some fractions such as 5/121 return nothing at all because the denominators outgrow exact arithmetic, which says nothing about whether the input was valid. Which fractions are you decomposing: a puzzle, a class exercise, or history?

Popular calculators

All Calculators