📢 Advertisement — 728×90
📢 Advertisement

The Egyptian Fractions Calculator provided by Hesapstan decomposes a positive rational number into a sum of distinct unit fractions and shows each step of the greedy algorithm.

An Egyptian fraction writes a number as a sum of distinct unit fractions

An Egyptian fraction represents a positive rational number as a sum of different fractions of the form 1/n. For example, 2/3 can be written as 1/2 + 1/6. Both terms are unit fractions, and their denominators are different.

This calculator uses the greedy algorithm to produce one valid Egyptian fraction expansion. It is meant to show the method step by step, not just the final answer.

Direct definition

An Egyptian fraction is a representation of a positive rational number as a sum of distinct unit fractions.

A unit fraction has 1 as its numerator

A unit fraction is a fraction whose numerator is 1, such as 1/2, 1/3, or 1/10. Egyptian fraction notation uses sums of unit fractions rather than repeated copies of the same fraction.

Because the denominators are distinct, the result is different from simply rewriting 2/3 as 1/3 + 1/3. The goal is a unit-fraction expansion with different denominators.

The greedy algorithm chooses the largest suitable unit fraction at each step

For a fraction p/q, the greedy algorithm takes the ceiling of q/p and chooses the unit fraction 1/⌈q/p⌉. It then subtracts that unit fraction from the remaining fraction and repeats until the remainder is zero.

For 2/3, q/p is 3/2, so the first unit fraction is 1/2. The remaining fraction is 2/3 − 1/2 = 1/6, so the expansion is 1/2 + 1/6.

It is not always the shortest expansion

The greedy algorithm is standard and easy to follow, but it does not guarantee the minimum number of terms. This calculator shows the greedy decomposition, not a global optimal search.

📢 Advertisement

This calculator is designed for positive rational inputs

You can enter a value in numerator/denominator form. Supported decimal inputs are treated as rational decimal values, but if exactness matters, entering the fraction directly is clearer.

Zero and negative values are outside the scope of this calculator. For supported values greater than 1, the integer part may be separated before the fractional part is decomposed into unit fractions.

Irrational numbers are not supported

Values such as √2 or π are not Egyptian fraction inputs for this tool. The calculator is for positive rational numbers.

The step table shows the remainder and the unit fraction chosen

Each row of the step table shows the current remainder, the unit fraction chosen by the greedy rule, and the new remainder after subtraction. This makes the process useful for learning the algorithm, not only checking an answer.

When the remainder becomes zero, the selected unit fractions add back to the original input. The verification line confirms that the produced sum matches the starting fraction.

The iteration limit prevents extremely long edge-case decompositions

Some inputs can lead to many greedy steps. The runtime includes a safety limit so that edge cases do not make the process run without control.

If a value reaches the limit, try a simpler fraction or write the input explicitly as numerator/denominator instead of a decimal approximation.

Examples show how the decomposition is built

Egyptian fraction for 2/3

Giriş / Input: 2/3 — Sonuç / Output: 1/2 + 1/6 — The first selected unit fraction is 1/2, and the remaining fraction is 1/6.

Egyptian fraction for 3/4

Giriş / Input: 3/4 — Sonuç / Output: 1/2 + 1/4 — After subtracting 1/2, the remainder is 1/4, which is already a unit fraction.

Egyptian fraction for 7/8

Giriş / Input: 7/8 — Sonuç / Output: 1/2 + 1/4 + 1/8 — The remainders are 3/8 and then 1/8, so the result is a sum of three distinct unit fractions.

Frequently Asked Questions

What are Egyptian fractions?

Egyptian fractions are representations of positive rational numbers as sums of distinct unit fractions, such as 2/3 = 1/2 + 1/6.

What is a unit fraction?

A unit fraction is a fraction with numerator 1. Examples include 1/2, 1/5, and 1/12.

How does the greedy algorithm work?

At each step, it chooses the largest unit fraction that does not exceed the remaining fraction, subtracts it, and repeats until the remainder is zero.

Is the result always the shortest Egyptian fraction expansion?

No. The greedy algorithm gives a standard step-by-step decomposition, but it does not guarantee the fewest possible terms.

Can I enter a fraction greater than 1?

In supported cases, the integer part may be separated and the fractional part decomposed. The clearest input is still a positive rational value written as numerator/denominator.

Can I enter zero or a negative fraction?

No. This calculator is designed for positive rational numbers only.

Why is there an iteration limit?

Some edge-case inputs may require many greedy steps. The limit prevents the calculation from running too long or producing an impractical table.

📢 Advertisement

Related Calculators

Division Calculator½Adding and Subtracting Fractions Calculator🔁Reciprocal / Multiplicative Inverse Calculator🔢Expanded Form Calculator