def get_e_continued_fraction(n):
  """ Return the first n digits of the continued fraction of e."""
  if not n:
    return []
  result = [2] # First digit
  n -= 1
  k = 1
  # Pattern is 1,2k,1...
  for i in range(n):
    if i % 3 == 1:
      result.append(k * 2)
      k += 1
    else:
      result.append(1)
  return result