def uniform_but_one_dataset_no_weight(n, p):
  """Generates an unweighted dataset according to the AMS lower bound.

  Args:
    n: The size of the dataset
    p: The frequency moment (used as a parameter in the lower bound)

  Returns:
    A list of keys, where all keys appear once, except for one key which
    accounts for half of the p-th frequency moment
  """
  elements = []
  for i in range(n):
    elements.append(i)
  for i in range(int(n**(1.0 / p)) - 1):
    elements.append(1)
  return elements