input: Write a function to generate a sequence where each element is double the previous one, starting with 1.
  assert generate_sequence(7) == [1, 2, 4, 8, 16, 32, 64]
  assert generate_sequence(5) == [1, 2, 4, 8, 16]
  assert generate_sequence(3) == [1, 2, 4]
output: def generate_sequence(n):
      sequence = [1]
      for _ in range(1, n):
          sequence.append(sequence[-1] * 2)
      return sequence