def egyptian_fraction(r, algorithm='Greedy'):
 if (r <= 0):
  raise ValueError('Value must be positive')
 (prefix, rem) = egypt_harmonic(r)
 if (rem == 0):
  return prefix
 (x, y) = rem.as_numer_denom()
 if (algorithm == 'Greedy'):
  return (prefix + egypt_greedy(x, y))
 elif (algorithm == 'Graham Jewett'):
  return (prefix + egypt_graham_jewett(x, y))
 elif (algorithm == 'Takenouchi'):
  return (prefix + egypt_takenouchi(x, y))
 elif (algorithm == 'Golomb'):
  return (prefix + egypt_golomb(x, y))
 else:
  raise ValueError('Entered invalid algorithm')

def egyptian_fraction ( r , algorithm = 'Greedy' ) : if ( r <= 0 ) : raise ValueError ( 'Value must be positive' ) ( prefix , rem ) = egypt_harmonic ( r ) if ( rem == 0 ) : return prefix ( x , y ) = rem . as_numer_denom ( ) if ( algorithm == 'Greedy' ) : return ( prefix + egypt_greedy ( x , y ) ) elif ( algorithm == 'Graham Jewett' ) : return ( prefix + egypt_graham_jewett ( x , y ) ) elif ( algorithm == 'Takenouchi' ) : return ( prefix + egypt_takenouchi ( x , y ) ) elif ( algorithm == 'Golomb' ) : return ( prefix + egypt_golomb ( x , y ) ) else : raise ValueError ( 'Entered invalid algorithm' )
return the list of denominators of an egyptian fraction expansion [1]_ of the said rational r .