Wolfram Research

Function Repository Resource:

EgyptianFraction

Source Notebook

Compute Egyptian fractions using different methods

Contributed by: David Eppstein

ResourceFunction["EgyptianFraction"][fraction]

gets Egyptian fractions from fraction using different methods.

Details and Options

Egyptian fractions give a fraction represented as a sum of fractions with numerator one.
Methods available include "Greedy", "Harmonic", "Odd Greedy", "Pairing", "Splitting", "Binary", "BinaryRemainder", "ContinuedFraction", "GroupedContinuedFraction" and "Hybrid".

Examples

Basic Examples

Ask for any fraction:

In[1]:=
ResourceFunction["EgyptianFraction"][16/77]
Out[1]=

Check result:

In[2]:=
Plus @@ ResourceFunction["EgyptianFraction"][16/77]
Out[2]=

Display as a sum:

In[3]:=
Row[ResourceFunction["EgyptianFraction"][16/77], "+"]
Out[3]=

Options

Method

Try different methods:

In[4]:=
ResourceFunction["EgyptianFraction"][16/77, Method -> "Harmonic"]
Out[4]=

In[5]:=
ResourceFunction["EgyptianFraction"][4/81, Method -> "OddGreedy"]
Out[5]=

In[6]:=
ResourceFunction["EgyptianFraction"][18/23, Method -> "Pairing"]
Out[6]=

In[7]:=
ResourceFunction["EgyptianFraction"][5/6, Method -> "Splitting"]
Out[7]=

In[8]:=
ResourceFunction["EgyptianFraction"][8/453, Method -> "Binary"]
Out[8]=

In[9]:=
ResourceFunction["EgyptianFraction"][5/7841, Method -> "BinaryRemainder"]
Out[9]=

In[10]:=
ResourceFunction["EgyptianFraction"][47/59, Method -> "ContinuedFraction"]
Out[10]=

In[11]:=
ResourceFunction["EgyptianFraction"][31/311, Method -> "GroupedContinuedFraction"]
Out[11]=

In[12]:=
ResourceFunction["EgyptianFraction"][31/311, Method -> "Hybrid"]
Out[12]=

Requirements

Wolfram Language 11.3 (March 2018) or above

Resource History

Source Metadata

License Information