Egyptian Fractions Calculator: Greedy and Shortest Unit Fraction Sums
By FindMySum · Last reviewed
An Egyptian fraction calculator writes a fraction as a sum of distinct unit fractions, fractions with 1 on top. Ancient Egyptian scribes wrote all their fractions this way: 3/4 was 1/2 + 1/4, and 4/13 could be 1/4 + 1/18 + 1/468. This page finds the greedy expansion that Fibonacci described in 1202, shows each step, and searches for the shortest expansion, choosing the one with the smallest largest denominator when there are several. It also runs the other way, adding a list of unit fractions back into one fraction in lowest terms.
The greedy method, step by step
Take the largest unit fraction that fits, subtract it, and repeat on what is left. For a remainder p/q, the largest unit fraction not bigger than it is 1/⌈q/p⌉, where ⌈ ⌉ means round up.
The default is 4/13:
- ⌈13/4⌉ = ⌈3.25⌉ = 4. Take 1/4. What is left: 4/13 − 1/4 = 16/52 − 13/52 = 3/52.
- ⌈52/3⌉ = ⌈17.33⌉ = 18. Take 1/18. Left: 3/52 − 1/18 = 27/468 − 26/468 = 1/468.
- 1/468 is already a unit fraction. Take it. Nothing is left.
So 4/13 = 1/4 + 1/18 + 1/468.
Why it always stops: if the remainder is p/q and you take 1/d with d = ⌈q/p⌉, the new numerator is pd − q, which is smaller than p. The numerators fall each step, so after at most p steps the numerator reaches 1.
Shorter and smaller expansions
The greedy method isn't always the best. 4/13 also equals 1/4 + 1/26 + 1/52, still three terms but with a largest denominator of 52 instead of 468. Check: 13/52 + 2/52 + 1/52 = 16/52 = 4/13.
Sometimes the greedy result is badly longer. The famous case is 5/121:
- greedy: 1/25 + 1/757 + 1/763,309 + 1/873,960,180,913 + 1/1,527,612,795,642,093,418,846,225
- shortest: 1/33 + 1/121 + 1/363
The calculator's shortest-expansion search tries one term, then two, then three, and so on, with increasing denominators. For each number of terms k, the next denominator d has to satisfy 1/d ≤ remainder < k/d, which leaves only a finite list to try. Among the shortest expansions it keeps the one with the smallest largest denominator. The search has limits (up to 6 terms, denominators up to a million and a fixed amount of work) so it answers instantly; the result says when it was cut short.
Fractions bigger than 1
An improper fraction keeps its whole part: 7/3 = 2 + 1/3, and 11/4 = 2 + 1/2 + 1/4. The calculator expands only the proper part.
The Rhind papyrus
The Rhind Mathematical Papyrus, copied by the scribe Ahmes around 1550 BCE and now in the British Museum, starts with a table of 2/n for odd n from 5 to 101:
| 2/n | Rhind papyrus |
|---|---|
| 2/5 | 1/3 + 1/15 |
| 2/7 | 1/4 + 1/28 |
| 2/9 | 1/6 + 1/18 |
| 2/11 | 1/6 + 1/66 |
| 2/13 | 1/8 + 1/52 + 1/104 |
Egyptian multiplication worked by doubling, so doubling a unit fraction (turning 1/n into 2/n) came up all the time, and the table saved recalculating. The scribes' choices are not always greedy: for 2/13 the greedy method gives 1/7 + 1/91, but the papyrus prefers even denominators.
Turning unit fractions back into one fraction
To add unit fractions, find a common denominator, add the numerators and reduce:
1/4 + 1/18 + 1/468 = 117/468 + 26/468 + 1/468 = 144/468 = 4/13.
Choose "Unit fractions → one fraction" and type the fractions, or just their denominators (4, 18, 468). The calculator also says whether the list is a true Egyptian fraction, with no repeated denominators.
Famous facts and open problems
- 1 = 1/2 + 1/3 + 1/6 is the shortest way to write 1 with distinct unit fractions. Another is 1/2 + 1/3 + 1/7 + 1/42.
- The Erdős–Straus conjecture says 4/n is always a sum of three unit fractions. It is unproved.
- Every fraction with an odd denominator can be written with only odd denominators, but whether the greedy method restricted to odd denominators always stops is another open question.
More questions
Is every fraction an Egyptian fraction in some way?
Yes. Every positive rational number can be written as a finite sum of distinct unit fractions, and the greedy method proves it: each step makes the numerator of the remainder strictly smaller, so the process must stop. Fractions larger than 1 work too, either with a whole part or by using enough unit fractions, since 1/1 + 1/2 + 1/3 + … grows without bound.
How many ways can a fraction be written as an Egyptian fraction?
Infinitely many. Any term 1/n can be split as 1/(n + 1) + 1/(n(n + 1)), so a longer expansion can always be made from a shorter one, as long as the new denominators don't clash with existing ones. That is why questions usually ask for the shortest expansion or the one with the smallest denominators.
Did the Egyptians use the greedy algorithm?
Not consistently. The Rhind papyrus 2/n table often prefers expansions with small, even denominators that were easy to work with, rather than the greedy result. For 2/n they mostly used two to four terms and avoided very large denominators.
Are Egyptian fractions used today?
Mostly in number theory and puzzles, but the idea appears in fair-division problems and in scheduling, and unit fraction sums are a classic programming exercise for exact rational arithmetic. They also show students that fractions can be decomposed in more than one way.
What is the difference between 2/3 and the other Egyptian fractions?
2/3 had its own hieroglyph and was the one non-unit fraction the Egyptians used freely; some texts also had a sign for 3/4. Everything else was written as a sum of distinct unit fractions.
Sources
This article explains how the calculator works and is general information, not financial, tax, legal or medical advice. Rules change; check the sources above or a qualified professional before you act.