Egyptian Fractions and the Greedy Method for Finding Them
Write any proper fraction as a sum of different unit fractions, see why the greedy method always finishes, and learn where it goes astray.
Key takeaways
- An Egyptian fraction expresses a number as a sum of unit fractions with distinct denominators.
- The greedy method repeatedly subtracts the largest unit fraction that does not exceed the remainder.
- It must terminate for a fraction between 0 and 1, because the numerator of the remainder gets smaller at every step.
- Every such fraction has infinitely many representations, and the greedy one is often far from the neatest.
An Egyptian fraction is a sum of different unit fractions, fractions with numerator 1, such as 5/6 = 1/2 + 1/3. Every positive fraction smaller than 1 can be written this way. The simplest way to find such a sum is the greedy method: take the largest unit fraction that fits, subtract it, and repeat on what is left.
The method always stops after finitely many steps. It does not always give the shortest answer or the smallest denominators, and the gap between greedy and clever can be enormous.
Where the name comes from
Scribes in ancient Egypt wrote most fractions as sums of unit fractions, with a special sign for a few others, notably 2/3. The best known source is the Rhind Mathematical Papyrus, copied around 1550 BCE by a scribe named Ahmes from an older text.
It opens with a table that breaks fractions of the form 2/n into unit fractions for odd values of n up to 101. For instance it gives 2/7 as 1/4 + 1/28. A table like this was a working tool, much as multiplication tables are.
The notation has practical sense. Suppose 5 loaves are to be shared among 8 people. Since 5/8 = 1/2 + 1/8, give everyone half a loaf, then cut the remaining loaf into eighths. Each person gets two visibly equal pieces.
The greedy method
For a fraction a/b between 0 and 1:
- Find the smallest whole number n with 1/n ≤ a/b. That is b ÷ a rounded up.
- Write down 1/n.
- Subtract it: the remainder is (an − b)/(bn). Reduce it if you can.
- If the remainder is 0, stop. Otherwise repeat from step 1.
The English-speaking tradition often links the method to J. J. Sylvester, who studied it in 1880. Much earlier, Fibonacci described it, among other techniques, in his Liber Abaci of 1202.
A worked example: 4/13
13 ÷ 4 = 3.25 round up: n = 4
4/13 − 1/4 = 16/52 − 13/52 = 3/52
52 ÷ 3 = 17.33... round up: n = 18
3/52 − 1/18 = 54/936 − 52/936 = 2/936 = 1/468
so 4/13 = 1/4 + 1/18 + 1/468 The final remainder was already a unit fraction, so the process ends. As a check, in 468ths the three terms are 117, 26 and 1, which total 144, and 4/13 is also 144/468.
Why it always stops
Look at the numerator of the remainder, an − b. Because n is the smallest number that works, the next larger unit fraction, 1/(n − 1), is too big. (Here n is at least 2, since a/b is less than 1.)
1/(n − 1) > a/b
b > a(n − 1) multiply across; both denominators are positive
b > an − a
a > an − b rearrange So the new numerator an − b is smaller than the old numerator a, and it is at least 0. Reducing the remainder can only shrink it further. A decreasing list of whole numbers that never goes below 0 must end, and so the method finishes in at most a steps.
A similar argument shows that the denominators are all different. After subtracting 1/n, the remainder is less than 1/(n − 1) − 1/n, which is 1/(n(n − 1)). For n of at least 2 that is no larger than 1/n. So the remainder is smaller than the piece just taken, and the next unit fraction must have a larger denominator.
This is a typical use of induction on the numerator, or equivalently of a quantity that only decreases.
When greed goes wrong
Try 4/17.
greedy: 4/17 = 1/5 + 1/29 + 1/1233 + 1/3039345
shorter: 4/17 = 1/6 + 1/15 + 1/510 Both are correct. The greedy sum has four terms and a denominator over three million. The second has three terms and nothing above 510. By refusing the largest first piece, you leave a remainder that is much friendlier.
A more dramatic case is 5/121. It equals 1/33 + 1/121 + 1/363. The greedy method instead produces the denominators 25, 757, 763,309, then a twelve-digit number and finally one with twenty-five digits. Each remainder is tiny and awkward, and each forces a denominator roughly the square of the one before.
Many representations
A fraction never has just one Egyptian form. This identity splits any unit fraction into two smaller ones:
1/n = 1/(n + 1) + 1/(n(n + 1))
for example 1/2 = 1/3 + 1/6 Apply it to the last term of any representation, which for n of at least 2 gives two new denominators larger than the old one. You get a longer representation, and you can keep going forever.
Special patterns give short forms. When p is an odd number of at least 3, 2/p can be written with two terms:
2/p = 1/((p + 1)/2) + 1/(p(p + 1)/2)
2/7 = 1/4 + 1/28
2/11 = 1/6 + 1/66 Other strategies
Factor hunting often beats greed. To expand a/b, multiply top and bottom by a convenient number, then try to write the new numerator as a sum of different divisors of the new denominator.
Take 5/12. The divisors of 12 include 3 and 2, and 5 = 3 + 2. So 5/12 = 3/12 + 2/12 = 1/4 + 1/6.
For 3/7, multiply by 4 to get 12/28. The divisors of 28 are 1, 2, 4, 7, 14 and 28, and 12 can be made as 7 + 4 + 1. So 3/7 = 1/4 + 1/7 + 1/28. Numbers with many divisors make the best multipliers, a good reason to practice finding divisors and common multiples.
When are two terms enough?
Some fractions with a numerator above 1 need only two unit fractions, and others cannot manage with two however you try. There is a clean test. For a fraction a/b in lowest terms with a greater than 1, you can write a/b = 1/x + 1/y exactly when b has two coprime divisors m and n whose sum is a multiple of a.
Check it on 3/10. The divisors 1 and 2 are coprime and add to 3. Setting k = 1, one gets 3/10 = 1/(10 × 1) + 1/(5 × 1), that is 1/10 + 1/5. The recipe is x = bk/m and y = bk/n, where k = (m + n)/a.
Now try 3/7. The only coprime pairs of divisors of 7 are 1 with 1 and 1 with 7, with sums 2 and 8, and neither is a multiple of 3. So 3/7 cannot be written with two unit fractions, and the three-term answer found above is as short as possible.
This kind of question, how few terms and how small the denominators, turns an old bookkeeping notation into real number theory. The answers depend on the prime factors of the denominator, which is why fractions with similar sizes can behave so differently.
A sharing problem
Say you want to divide 3 pizzas equally among 5 people using as few pieces per person as you can, with every person receiving an identical set. Each share is 3/5.
The greedy method takes 1/2 first, leaving 1/10. So each person gets half a pizza and a tenth. Five halves use two and a half pizzas, and the remaining half is cut into five tenths. It works exactly, with no scraps.
Compare this with simply cutting every pizza into fifths and handing out three small slices each. Both are fair in amount. The Egyptian version uses fewer pieces per person, 2 instead of 3, and makes the equality easy to see, because everyone holds the same shapes. The idea scales to other cases, though not always so tidily, since a greedy expansion can demand slivers far too thin to cut.
Reading an expansion critically
A quick estimate helps you catch errors. The first term of a greedy expansion should take more than half of the fraction when the numerator is at least 2, since neighboring unit fractions are close in size. The denominators should then grow fast. If your second denominator is smaller than your first, something went wrong.
The safest check is to add the terms back using a common denominator. For 3/5 the check is 5/10 + 1/10 = 6/10. Doing this takes seconds and verifies the whole chain of subtractions at once.
Open questions
Egyptian fractions still generate research. The best known puzzle is the Erdős-Straus conjecture: for every whole number n of at least 2, the fraction 4/n is a sum of three unit fractions, not necessarily different in the usual statement. It has been verified by computer to very large bounds and remains open as of the mid-2020s. The details are in the Erdős-Straus conjecture.
Another question concerns the greedy method applied only to odd denominators. A fraction with odd denominator can always be written with distinct odd unit fractions, but whether the odd greedy method always terminates is not known.
Practice
Expand 7/15 greedily. The first step uses n = 3, since 15 ÷ 7 is just over 2. The remainder is 7/15 − 1/3 = 2/15. Next, 15 ÷ 2 = 7.5 gives n = 8, and 2/15 − 1/8 = 1/120. So 7/15 = 1/3 + 1/8 + 1/120.
Can you do better? Multiply to get 14/30 and look for divisors of 30 adding to 14. Since 10 + 3 + 1 = 14, we get 1/3 + 1/10 + 1/30, with a much smaller largest denominator.
Common mistakes
- Repeating a term. Writing 2/5 = 1/5 + 1/5 is true but does not count.
- Rounding down instead of up in step 1, which picks a unit fraction too large to subtract.
- Forgetting to reduce the remainder, which makes later denominators needlessly large.
- Assuming greedy means shortest. It means only that each choice looks best at the moment.
Common questions
Can numbers larger than 1 be written this way?
Yes. Because the sum 1/2 + 1/3 + 1/4 + ... grows without bound, any positive rational number can be written as a sum of distinct unit fractions, although it may need very many terms.