Last chance! 50% off unlimited learning
Sale ends in
egyptian_complete(a, b)
0 < a/b < 1
, generates all Egyptian fractions
of length 2 and three, that is finds integers x1, x2, x3
such that a/b = 1/x1 + 1/x2
a/b = 1/x1 + 1/x2 + 1/x3
.
egyptian_methods
egyptian_complete(6, 7) # 1/2 + 1/3 + 1/42
egyptian_complete(8, 11) # no solution found
# TODO
# 2/9 = 1/9 + 1/10 + 1/90 is not recognized
# 13/30 = 1/3 + 1/(3*4) + 1/(3*5) -"-
Run the code above in your browser using DataLab