Egyptian Fractions Converter — Sum of Distinct Unit Fractions (Greedy Algorithm)

Express any fraction as a sum of distinct unit fractions (Egyptian fractions) using the greedy Fibonacci–Sylvester algorithm. See the step-by-step expansion, term count and largest denominator, computed exactly with BigInt — live in your browser.

Converter Number Systems Updated Jun 21, 2026
How to Use
  1. Type the numerator and denominator of your fraction (it may be larger than 1 — the whole-number part is pulled out automatically).
  2. Read the Egyptian expansion: a sum of distinct unit fractions 1/n, shown stacked.
  3. Open the steps to see each remainder shrink as the next unit fraction is subtracted.
  4. Check the term count and largest denominator, then copy the result.
= sum of distinct unit fractions

Writing fractions the way the ancient Egyptians did

An Egyptian fraction is a sum of distinct unit fractions — fractions of the form 1/n whose numerator is always 1, with no denominator repeated. Around 1650 BC the scribe Ahmes recorded exactly these decompositions in the Rhind Mathematical Papyrus: the Egyptians had no way to write a numerator larger than one, so 2/3 was set down as 1/2 + 1/6 rather than left as a single symbol. This converter takes any positive fraction a/b — it may be larger than 1, in which case the whole-number part is pulled out first — and rewrites it as that kind of sum, computed exactly in your browser with BigInt so nothing is ever rounded.

The greedy (Fibonacci–Sylvester) algorithm

The expansion shown here is the classic greedy one. At each step you subtract the largest unit fraction that still fits inside the remainder. For a remaining value a/b you take d = ⌈b/a⌉ (the denominator b divided by the numerator a, rounded up), emit 1/d, then replace the remainder with a/b − 1/d = (a·d − b)/(b·d) and reduce it to lowest terms. You repeat until the remainder hits zero. Fibonacci proved this process always terminates, because the numerator of the remainder strictly decreases at every step. The trade-off is that the denominators can grow very fast — sometimes nearly squaring each round — which is why exact BigInt arithmetic matters, and why the greedy expansion is rarely the shortest possible one.

Worked example: 4/5

Start with 4/5. The largest unit fraction not exceeding it is 1/2 (since ⌈5/4⌉ = 2); subtract to get 4/5 − 1/2 = 3/10. The largest fitting now is 1/4 (⌈10/3⌉ = 4); subtract to get 3/10 − 1/4 = 1/20, which is already a unit fraction. So 4/5 = 1/2 + 1/4 + 1/20, and those three reciprocals add back to exactly 4/5.

Quick reference

Greedy step
d = ⌈b ÷ a⌉, emit 1/d
New remainder
a/b − 1/d = (a·d − b)/(b·d)
2/3
= 1/2 + 1/6
3/4
= 1/2 + 1/4
4/5
= 1/2 + 1/4 + 1/20
Rule
all denominators distinct

About the Egyptian Fractions Converter — Sum of Distinct Unit Fractions (Greedy Algorithm)

Need a hand with everyday tasks? The Egyptian Fractions Converter — Sum of Distinct Unit Fractions (Greedy Algorithm) does the work for you — free, and right here in your browser. Express any fraction as a sum of distinct unit fractions (Egyptian fractions) using the greedy Fibonacci–Sylvester algorithm. See the step-by-step expansion, term count and largest denominator, computed exactly with BigInt — live in your browser.

How it works

Enter a number and choose your units — the converted value shows instantly. Everything runs locally, so nothing you type leaves your device. Double-check the direction of the conversion and you are set.

Want the deeper story? The Knowledge Base explains the ideas behind the tools in more detail.

Frequently Asked Questions

What is an Egyptian fraction?

An Egyptian fraction is a sum of distinct unit fractions — fractions of the form 1/n with numerator 1. The ancient Egyptians (notably in the Rhind Mathematical Papyrus, c. 1650 BC) wrote every fraction this way, with no repeated denominators. For example 2/3 is written 1/2 + 1/6, not 1/3 + 1/3.

How does the greedy (Fibonacci–Sylvester) algorithm work?

At each step you take the largest unit fraction that does not exceed the remaining value. For a remainder a/b you compute d = ⌈b/a⌉ (round b÷a up), emit 1/d, then replace a/b with a/b − 1/d = (a·d − b)/(b·d) and reduce. Repeat until the remainder is zero. Fibonacci proved this always terminates.

Why can the denominators get so large?

The greedy method is simple but not always shortest: after a few steps the numerator of the remainder shrinks while the denominator can roughly square, so denominators sometimes explode (5/121 needs a 25-digit denominator). This tool uses exact BigInt arithmetic so the values are never rounded, and caps the number of terms with a friendly note if an input runs unusually long.

Is the expansion unique or the shortest?

No. A fraction has infinitely many Egyptian-fraction representations, and the greedy one is rarely the shortest. This tool shows the canonical greedy expansion, which is deterministic and easy to verify — every term is distinct and the unit fractions add back to your input exactly.

Is anything uploaded?

No. The whole computation runs in your browser with JavaScript and BigInt — nothing is sent to a server.

How do I use the Egyptian Fractions Converter — Sum of Distinct Unit Fractions (Greedy Algorithm)?

Simply type or paste your value and read the result, which refreshes the instant you change something. There is nothing to submit and nothing to wait for.

Is it free? Does it work without internet?

Yes to both. It is free with no sign-up, and once the page has loaded it keeps working even with no internet.

Where does my data go?

Nowhere — every calculation runs on your own device. Nothing you enter is uploaded, logged, or stored.

Common Use Cases

Learning number theory

See the greedy algorithm play out term by term, with each exact remainder shown, when studying Egyptian fractions or unit-fraction decompositions.

Teaching ancient mathematics

Reproduce the kind of decomposition found in the Rhind Papyrus to show how the Egyptians recorded fractions without a numerator above one.

Puzzle & competition math

Quickly generate a distinct-unit-fraction representation for contest problems and check that it sums back exactly.

Exact-arithmetic sanity checks

Confirm a fraction equals a particular sum of reciprocals using verified BigInt arithmetic rather than floating point.

Last updated: