code: def egypt_graham_jewett(x, y):
      # assumes gcd(x, y) == 1
      l = [y] * x
  
      # l is now a list of integers whose reciprocals sum to x/y.
      # we shall now proceed to manipulate the elements of l without
      # changing the reciprocated sum until all elements are unique.
  
      while len(l) != len(set(l)):
          l.sort()  # so the list has duplicates. find a smallest pair
          for i in range(len(l) - 1):
              if l[i] == l[i + 1]:
                  break
          # we have now identified a pair of identical
          # elements: l[i] and l[i + 1].
          # now comes the application of the result of graham and jewett:
          l[i + 1] = l[i] + 1
          # and we just iterate that until the list has no duplicates.
          l.append(l[i] * (l[i] + 1))
      return sorted(l)
  
file_path: sympy/sympy/ntheory/egyptian_fraction.py
imports: from sympy.core.containers import Tuple
  from sympy.core.numbers import Integer, Rational
  from sympy.core.singleton import S
  import sympy.polys
  from math import gcd
label_desc: Use image node_id 3 for calling a global function with example usage: egypt_graham_jewett(x, y) and returns: sorted