def generalized_fibonacci_sequence(n, p):
  """Compute the generalized Fibonacci sequence.

  Args:
    n: An `int`. The number of terms to compute. Must be >= 2.
    p: An `int`. The number of the generalized sequence. Must be >= 1. If `p` is
      1, the sequence is the standard Fibonacci sequence.

  Returns:
    A list of `int`s.
  """
  a = [1, p]
  for _ in range(n - 2):
    a.append(a[-2] + a[-1])
  return a