Mathematics calculator

Egyptian Fraction Calculator

Decompose a positive proper fraction into a sum of distinct unit fractions using the greedy algorithm.

Calculator inputs

Enter your values

Unit-fraction decomposition
Enter numerator/denominator; the denominator may not exceed 100,000.
Calculated output

Result summary

Your result will appear here

Complete the required fields and select the calculate button.

What is Egyptian Fractions?

An Egyptian fraction represents a positive proper fraction as a sum of distinct unit fractions. A unit fraction has numerator 1, such as 1/4 or 1/18. This calculator uses the Fibonacci–Sylvester greedy method: at each step it selects the largest unit fraction that does not exceed the remaining fraction.

The tool is intended for exact arithmetic and mathematical exploration. Enter a positive fraction smaller than one, with whole-number numerator and denominator. The result can differ from another valid Egyptian-fraction expansion because a rational number may have many decompositions.

How to Use This Calculator

  1. Keep Greedy algorithm selected and enter a fraction in numerator/denominator form, such as 4/13. Spaces around the slash are accepted.
  2. The next unit denominator is the ceiling of denominator divided by numerator. That choice gives the largest unit fraction no greater than the current remainder.
  3. The selected unit fraction is subtracted exactly, the remainder is reduced by its greatest common divisor, and the process repeats until the remainder is zero.

The accepted domain is a positive proper fraction: numerator at least 1, denominator at least 2 and numerator smaller than denominator. The denominator may be no greater than 100,000. Zero, negative values, decimals, mixed numbers and improper fractions are rejected. Reduce the input first if desired, although the exact remainder is reduced during the calculation.

Formula Used

For a remaining fraction a/b, choose n = ceil(b/a). Then write a/b = 1/n + (an − b)/(bn). Reduce the second fraction and apply the same rule again until its numerator is zero.

Because 1/n is the largest unit fraction no greater than a/b, the method is called greedy. The resulting denominators increase, so terms are distinct. The method gives a finite decomposition for every positive rational fraction in the supported domain.

Variables Explained

Egyptian-fraction symbols and entries
Symbol or entryMeaningRule
aNumerator of the current remaining fraction.A positive whole number smaller than b at the start.
bDenominator of the current remaining fraction.A whole number of at least 2 and no more than 100,000 at entry.
nDenominator of the next unit fraction.ceil(b/a), the smallest integer not below b/a.
1/nLargest unit fraction that does not exceed the remainder.Added as the next distinct term.
ResultSum of unit fractions equal to the original value.Terms appear in increasing denominator order.

Worked Example

For 4/13, the first denominator is ceil(13/4) = 4, so choose 1/4. Subtracting gives 4/13 − 1/4 = (16 − 13)/52 = 3/52. Next, ceil(52/3) = 18, so choose 1/18. The remainder is 3/52 − 1/18 = (54 − 52)/936 = 2/936 = 1/468. The final expansion is 4/13 = 1/4 + 1/18 + 1/468.

Checking with the common denominator 936: 1/4 = 234/936, 1/18 = 52/936 and 1/468 = 2/936. Their sum is 288/936, which reduces to 4/13.

Why Use This Calculator?

Each displayed term has numerator one, and adding the terms exactly recovers the input fraction. The decomposition is valid even if it is not the shortest possible one. Greedy selection makes a local choice at each step; it does not search all possible representations for the fewest terms or smallest final denominator.

Different valid decompositions can therefore look very different. For example, 2/3 can be written as 1/2 + 1/6, while other longer representations also exist. Use a common denominator or exact rational arithmetic to verify an answer. Decimal approximations are useful for a quick check but may hide tiny rounding differences.

Common Mistakes

  • Entering an improper fraction such as 7/4; this form is limited to values strictly between zero and one.
  • Using a decimal instead of numerator/denominator notation.
  • Choosing the nearest integer for b/a instead of the ceiling, which can make the unit fraction too large.
  • Forgetting to reduce the remainder before the next step.
  • Assuming the greedy result must use the fewest possible terms.
  • Checking only rounded decimals rather than proving the unit fractions sum exactly.

Frequently Asked Questions

What is a unit fraction?

It is a positive fraction with numerator 1 and a positive integer denominator, such as 1/5. An Egyptian-fraction expansion uses distinct unit fractions.

Why is the method called greedy?

At each step it takes the largest unit fraction that fits within the current remainder, without searching ahead for the globally shortest expansion.

Does every proper fraction have an expansion?

Yes. The Fibonacci–Sylvester greedy procedure terminates for positive rational proper fractions, although some outputs can have large denominators.

Is the answer unique?

No. Many fractions have multiple valid Egyptian-fraction representations. This calculator reports the deterministic result of the greedy choice.

Can I enter an improper fraction or mixed number?

No. Convert or separate it first; this form accepts only positive whole-number numerator and denominator with numerator smaller than denominator.

How can I verify the result?

Add the unit fractions using a common denominator and reduce the sum. It should equal the original fraction exactly, as shown in the 4/13 example.

Sources & References