Egyptian fractions

Edit the example and calculate.

Enter a nonnegative fraction, decimal or mixed number and write it as a sum of distinct unit fractions with the greedy method. For example, 2/11 = 1/6 + 1/66. If the term limit cuts the decomposition short, the calculator also shows the exact remainder that is still missing.

Enter the values

Enter a nonnegative rational number. Limit: 25 terms and 1,000 digits per unit denominator. If a limit is reached, the exact partial sum and remainder are shown.

Result

Exact where indicated

Complete the fields and select Calculate.

Separate the integer part and find unit fractions with the greedy method.

Example: 4/13 = 1/4 + 1/18 + 1/468

Worked example

Subtract the largest unit fraction each time

The greedy method subtracts the largest unit fraction that fits in what is left, until nothing remains.

4/13 − 1/4 = 3/52; 3/52 − 1/18 = 1/468. 4/13 = 1/4 + 1/18 + 1/468, because 117/468 + 26/468 + 1/468 = 144/468 = 4/13.

How is this result checked?Report an errorHow we handle corrections

Key facts

What it is
A sum of unit fractions, all with numerator 1 and different denominators: 5/8 = 1/2 + 1/8.
Choosing each term
Subtract the largest unit fraction that fits in the remainder: 1/n, with n equal to d ÷ a rounded up. For 3/10, n = 4 and 1/20 is left.
Whole part
It is split off before starting: 9/8 = 1 + 1/8. Zero gives the empty sum, shown as 0.
Large denominators
They grow fast: 4/17 needs four terms and the last denominator has seven digits.
Limits
0 to 25 terms, denominators up to 1,000 digits and 3 seconds of computing. If it stops early, the partial sum and the exact remainder appear.

Formula

a/d = 1/n + (a·n − d)/(d·n), with n = ceiling(d/a)

Example:2/9 = 1/5 + 1/45

a/d is the current remainder, between 0 and 1. The new numerator is a·n − d.

Published · Updated

An Egyptian fraction is a sum of distinct unit fractions. The greedy method, which this calculator uses, subtracts the largest unit fraction that fits in what is left at each step. To write a fraction greater than 1, first split off its whole part.

Decomposing 4/13 with the greedy method

Each step has two parts: choosing the denominator and subtracting. The denominator comes from dividing the remainder’s denominator by its numerator and rounding up.

Worked example: from fraction to unit fractions

Write 4/13 as a sum of distinct unit fractions.

  1. First term: 13 ÷ 4 = 3.25, which rounds up to 4. Take the unit fraction with denominator 4; a larger one no longer fits.
  2. First remainder: 4/13 − 1/4 = 16/52 − 13/52 = 3/52.
  3. Second term: 52 ÷ 3 = 17.33…, which rounds up to 18. The unit fraction is 1/18.
  4. Second remainder: 3/52 − 1/18 = 27/468 − 26/468 = 1/468.
  5. Third term: the remainder is already a unit fraction, so it is added as it is and nothing is left.

Result: 4/13 = 1/4 + 1/18 + 1/468.

Check: 1/4 + 1/18 = 11/36, and 4/13 − 11/36 = 144/468 − 143/468 = 1/468, exactly the last term.

The denominators 4, 18 and 468 grow at each step, so no term repeats, and the process ends when the remainder is 0.

What the method gives for different fractions

Greedy decomposition of three fractions
FractionGreedy decompositionWhat to notice
2/131/7 + 1/91Two terms, and the second denominator is 13 times the first
7/151/3 + 1/8 + 1/120Three terms, increasing denominators
3/71/3 + 1/11 + 1/231Three terms, and the last denominator is 11 times 21

The table shows that the number of terms does not follow the size of the fraction: 2/13 needs two, while 3/7 and 7/15 need three.

How to read an incomplete result

When the term limit cuts the process off before it reaches 0, the sum you get is not yet your fraction. Add the exact remainder shown below it and you recover the input value. If you set a low limit on purpose, you can follow the method term by term and compare each remainder with your own work by hand.

To add terms with different denominators you need a common denominator, and equivalent fractions help there. If you want another way to write a rational number as a chain of operations, continued fractions express it with nested reciprocals. The guide to unit fractions explains how to compare and order them, and the article on the history of fractions covers their origin.

Sources

English Wikipedia, article Egyptian fraction: defines an Egyptian fraction as a finite sum of distinct unit fractions, notes that Fibonacci’s greedy algorithm is sometimes attributed to Sylvester, shows that a number can have several expansions, and gives 5/121 as a case where the greedy expansion is longer than 1/33 + 1/121 + 1/363 (accessed October 17, 2026).

Frequently asked questions

Is the Egyptian fraction decomposition unique?

No. The same fraction can be written as several sums of distinct unit fractions. For example, 5/6 = 1/2 + 1/3 and also 5/6 = 1/2 + 1/4 + 1/12, because 6/12 + 3/12 + 1/12 = 10/12. The calculator always applies the greedy method, so the same input gives the same result.

Why does the greedy method always end?

At each step the new numerator, a·n − d, is a nonnegative integer smaller than the previous numerator a. A sequence of integers that keeps going down has to reach 0, and that happens in at most a steps. In the worked example the numerators are 4, 3, 1 and 0, and the process stops.

Why are they called Egyptian fractions?

Because ancient Egypt wrote fractions as sums of unit fractions. The Ahmes papyrus, also called the Rhind papyrus, from around 1650 BC and kept in the British Museum, is one of the documents that shows this. The background is in the history of fractions. The greedy method is also called Sylvester's algorithm.

What is the shortest decomposition of a fraction?

There is no simple formula, and the greedy method does not always give it. For 5/121 it gives five terms and the last denominator has 25 digits, while 5/121 = 1/33 + 1/121 + 1/363 uses three: 11/363 + 3/363 + 1/363 = 15/363 = 5/121. To look for a shorter one you have to try other combinations.

Next step

Continued fractions Turn a fraction into [a0; a1, a2…] and see its convergents, or rebuild the fraction from the coefficients.

YOUR CALCULATOR, CLOSE AT HAND

Save your calculator

Open your browser menu and choose “Install app” or “Add to Home Screen”. You can also bookmark this page.