Maths & numbers

Egyptian fraction decomposition calculator

Apply the greedy algorithm to express a positive proper fraction as a sum of distinct unit fractions.

Your numbers

Calculated on your device. Your inputs aren’t sent to us.

Your result

Ready when you are

Enter your inputs and select Calculate.

Report an issue

Behind the numbers

How this calculation works

The first unit fraction is the largest one that fits inside the remainder. Other sums may represent the same fraction.

THE FORMULARepeatedly subtract 1/ceil(b/a) from the remaining fraction a/b

A worked example

4/13 becomes 1/4, then 1/18, then 1/468.

Good to know

Use a proper fraction. The greedy sum can have large denominators.

Take the largest unit fraction that fits

A unit fraction has numerator one. Starting from 4/13, choose the largest unit fraction that does not exceed it. Since 13/4 = 3.25, round that denominator upward to 4 and take 1/4. The remainder is 4/13 − 1/4 = 3/52.

Repeat the rule on 3/52. The next denominator is the ceiling of 52/3, or 18, giving a remainder of 3/52 − 1/18 = 1/468. The final remainder is already a unit fraction, so the decomposition is 1/4 + 1/18 + 1/468. On a shared denominator of 468 the numerators are 117 + 26 + 1 = 144, matching 4/13 = 144/468.

The fraction four thirteenths splits into one quarter, one eighteenth and one four hundred sixty-eighth117/468 = 1/426/468 = 1/181/468Total = 144/468 = 4/13
The three bar sections have lengths proportional to 117, 26 and 1 on a common denominator of 468. Together they make 144/468.

Understand what the greedy rule chooses

The method makes a local choice at every step, using the largest eligible unit fraction. The next remainder is smaller, and the process terminates for a positive rational proper fraction. The denominators can become large, as 468 in this short example illustrates. Exact integer arithmetic prevents those denominators from introducing decimal-rounding errors.

A fraction can have several valid unit-fraction sums. The greedy decomposition is not guaranteed to use the smallest possible number of terms. For example, 5/21 has the two-term representation 1/6 + 1/14, while the greedy rule begins with 1/5. Use the Cross multiplication check calculator to verify a proposed sum after combining its terms into one fraction.

A few questions, answered

Why are improper fractions excluded?

This implementation decomposes a positive share below one. Separate the whole-number part of an improper fraction before decomposing its remaining proper fraction.

Does a unit fraction need more than one step?

No. An input such as 1/7 is already a complete one-term representation.

Find your calculator

Start typing to explore the library.