def __compute_triangle_number(prior_number):
  """
  Determine the next triangle number from the given number or the given number
  if it is a triangle number.
  """

  number = -1
  n = 1

  while number < prior_number:
    number = n * (n + 1) /2
    n += 1

  return int(number)