Egyptian Fraction Calculator (Greedy Method)

Write a fraction as a sum of different unit fractions (1/n) using Fibonacci’s greedy method, with exact denominators and every step.

Bigger than the numerator, so the fraction is less than 1. Up to 1,000,000.

Results

4/13 as unit fractions
1/4 + 1/18 + 1/468
Number of unit fractions
3
Largest denominator
468
Greedy steps
4/13: 13 ÷ 4 rounded up is 4, so take 1/4. Left over: 4/13 − 1/4 = 3/52. 3/52: 52 ÷ 3 rounded up is 18, so take 1/18. Left over: 3/52 − 1/18 = 1/468. 1/468 is already a unit fraction, so it is the last term.

How it’s calculated

An Egyptian fraction writes a fraction as a sum of different unit fractions (fractions with 1 on top), the way scribes in ancient Egypt did. Every fraction less than 1 can be written this way. Fibonacci described a simple method in 1202, now called the greedy method: take away the biggest unit fraction that fits, then repeat with what is left.

next denominator c = q ÷ p, rounded up p/q − 1/c = (p × c − q) / (q × c)

The top of the leftover fraction always gets smaller, so the method always ends. Example: 4/13. 13 ÷ 4 = 3.25, rounded up is 4, so take 1/4: 4/13 − 1/4 = (16 − 13)/52 = 3/52. Next, 52 ÷ 3 = 17.33…, rounded up is 18: 3/52 − 1/18 = (54 − 52)/936 = 2/936 = 1/468, a unit fraction. So 4/13 = 1/4 + 1/18 + 1/468.

The greedy method does not always find the shortest answer, and its denominators can grow very fast (5/121 needs a 25-digit denominator). All arithmetic is exact. Very long denominators are shown by their first and last digits, and the method stops after 20 terms or once a denominator would pass 1,000 digits, showing what is left over.

Frequently asked questions

What is a unit fraction?

A fraction with 1 as its numerator, such as 1/2, 1/7 or 1/468.

Why did the Egyptians use unit fractions?

Their number writing had symbols for unit fractions (and 2/3), so other fractions were written as sums of different unit fractions, such as 3/4 = 1/2 + 1/4.

Is the greedy answer the shortest one?

Not always. 5/121 takes five terms by the greedy method, but a three-term answer exists: 1/33 + 1/121 + 1/363.

Can I expand a fraction bigger than 1?

Take out the whole number first. For 7/4 = 1 + 3/4, expand 3/4 = 1/2 + 1/4.

Embed this calculator

Add this free calculator to your own website. Copy the code below into your page’s HTML:

Need this calculator branded, changed or built around your own prices?See custom business solutions →

Sources

Formulas are taken from the free public references above. Results are provided “as is” for informational and educational purposes only. See our disclaimer.

Added · Last updated · How we check our calculators

Spotted a mistake or missing option? Report a problem· Suggest a calculator