An Egyptian fraction calculator writes a fraction as a sum of distinct unit fractions, such as 4/13 = 1/4 + 1/18 + 1/468. Enter a numerator and a denominator, and it applies the greedy algorithm that Fibonacci described, step by step, and gives the result in the form that the ancient Egyptians used.
How to use the Egyptian fraction calculator
- Enter the numerator and the denominator.
- Press Calculate.
- Read the sum of unit fractions.
What an Egyptian fraction is
An Egyptian fraction is a finite sum of distinct unit fractions, such as 1/2 + 1/3 + 1/16 [1]. Each term has a numerator of 1, and the denominators are different positive whole numbers. The page gives this example, which adds up to 43/48 [1]. The ancient Egyptians wrote most fractions in this way, and the form is still studied in number theory.
Every fraction has one
The page states that every positive rational number can be represented by an Egyptian fraction [1]. The expansion is not unique: a fraction can be written in many ways. The calculator finds one of them, which comes from a standard method, and the page notes other methods that give shorter or different sums for some numbers [1].
The greedy algorithm
Fibonacci suggested a greedy algorithm: repeatedly choose the unit fraction with the smallest denominator that is no larger than the fraction that remains [1]. In modern terms, x/y = 1/⌈y/x⌉ plus a remainder, and the remainder has numerator (−y) mod x, which is smaller than x [1]. Because the numerator shrinks at every step, the process ends after a finite number of terms [1]. The calculator carries it out with exact whole-number arithmetic.
The page's examples
The page gives 4/13 = 1/4 + 1/18 + 1/468 [1]. By hand: ⌈13/4⌉ = 4, which leaves 3/52, then ⌈52/3⌉ = 18, which leaves 1/468. It also gives 17/29 = 1/2 + 1/12 + 1/348 [1]. Enter these to check the calculator. Another example is 2/3 = 1/2 + 1/6, which is our own check: ⌈3/2⌉ = 2 leaves 1/6.
Large denominators
The greedy method can produce very large denominators. The page notes that 5/121 gives a long expansion with the greedy method, and that a shorter one is 1/33 + 1/121 + 1/363 [1]. Entering 5/121 gives 1/25 + 1/757 + 1/763309 + 1/873960180913 + 1/1527612795642093418846225. The calculator stops after 12 terms if the sum is not complete, and says so.
Sylvester's sequence
The page also describes the sequence 2, 3, 7, 43, 1807, which comes from an infinite greedy expansion for the number 1 [1]. It uses the floor of y/x plus one in place of the ceiling [1]. This gives the identity 1 = 1/2 + 1/3 + 1/7 + 1/43 + 1/1806 [1]. The calculator treats a whole number as a whole part, so for an improper fraction such as 7/3, the result is 2 + 1/3.
Proper and improper fractions
If the fraction is greater than 1, the calculator writes the whole part first and then expands the remainder. A fraction that is already a unit fraction is returned as it is. A fraction such as 6/8 is reduced to 3/4 first, since the same value has a shorter expansion, 1/2 + 1/4. The expansion of a whole number is just the number.
Why it still matters
Egyptian fractions are a source of problems and open questions in number theory, such as the shortest expansions and the smallest denominators. They are also a way to split quantities into equal shares, as the Egyptians did with bread and grain. A baker with 3 loaves for 4 people can give each half a loaf and a quarter, which is 3/4 = 1/2 + 1/4.
Using the calculator
Type the fraction, press the button and copy the result. Try fractions with different denominators to see how the greedy method behaves. The number of terms is often small, and sometimes the last denominator is very large. If you want a shorter expansion of a particular fraction, you can look for it by hand, using the greedy result as a check.
Sharing food
The Egyptians used unit fractions for dividing food among workers. To share 5 loaves among 8 people, write 5/8 as 1/2 + 1/8. Each person gets half a loaf and an eighth, which is easy to cut. The greedy calculation gives the same: ⌈8/5⌉ = 2, leaving 1/8. The method is still a good way to split a quantity when you want cuts that are simple.
Open questions
Mathematicians have shown that the expansion is not unique, and have studied the shortest ones, the smallest largest denominator and the number of ways to write a number. The greedy method does not always find the best. For instance, 5/121 has a short expansion with denominators 33, 121 and 363, while the greedy method gives a final denominator with 25 digits. Compare the two in the calculator.
Practice
Try 3/7, which gives 1/3 + 1/11 + 1/231, then 5/6, which gives 1/2 + 1/3, and 7/15, which gives 1/3 + 1/8 + 1/120. Check each by adding the unit fractions with a common denominator. These are our own examples of the greedy method.
Reading the working
The working line says how many terms were used, and whether a whole part was split off first. If the calculator stopped at 12 terms because the denominators grew so fast, it says so. In that case the sum shown is a part of the full expansion, and the result ends with an ellipsis, so you know it is not complete.
Common mistakes
- Expecting a unique answer. Many expansions exist.
- Repeating a unit fraction. The terms must be distinct.
- Entering a decimal. Use a whole numerator and denominator.
- Assuming the greedy result is shortest. It often is not.
What next
Use this often? Add Egyptian Fra to your Home screen.
Frequently asked questions
What is an Egyptian fraction calculator?
A tool that writes a fraction as a sum of distinct unit fractions.
What is an Egyptian fraction?
A finite sum of distinct unit fractions, such as 1/2 + 1/3 + 1/16.
How does the greedy algorithm work?
Take the unit fraction 1/⌈y/x⌉, subtract it, and repeat with the remainder.
Does every fraction have an Egyptian fraction?
Yes. Every positive rational number can be represented by one.
Is the expansion unique?
No. A fraction can have many expansions, and the greedy one is not always the shortest.
Sources
Was this tool helpful?
What went wrong?
We only receive the reason you pick, never what you typed into the tool.
Thanks for your feedback.