sympy/sympy — pull request #2663 by coder46 (2013-12-10 19:33:16+00:00)
Title: 4122 egyptian fractions

https://code.google.com/p/sympy/issues/detail?id=4122

Egyptian Fractions: Added various functions for
calcualting Egyptian Fractions to the Rational Class

Input a rational between 0 and 1, recieve a list of denominators of
an Egyptian fraction expansion of the said rational. This was
implemented by adding the following functions using various
algorithms to the Rational Class.

1)Rational(x,y).egypt_greedy() -->
Uses Fibonacci-Sylvester Algorithm

2)Rational(x,y).egypt_graham_jewett() -->
Uses Graham and Jewett Algorithm

3)Rational(x,y).egypt_takenouchi() -->
Uses the algorithm suggested by Takenouchi(1921)

In the next PR, I will add Engel expansions and four more
algorihthms computing egyptioan fractions

Examples:

In [1]: from sympy import Rational

In [2]: Rational(7,12).egypt_greedy()

Out [2]: [2, 12]

In [3]: Rational(7,12).egypt_takenouchi()

Out [3]: [3, 6, 12]