code: def find_spelling(n):
      
      r = 0
      d = n - 1
      # divmod used for large numbers
      quotient, remainder = divmod(d, 2)
      # while we can still divide 2's into n-1...
      while remainder != 1:
          r += 1
          d = quotient  # previous quotient before we overwrite it
          quotient, remainder = divmod(d, 2)
      return r, d
docs: Finds d, r s.t. n-1 = 2^r * d