code: def page_sequence(n_sheets: int, one_based: bool = True) -> List[int]:
      
      n_pages = calc_n_virtual_pages(n_sheets)
      assert n_pages % 4 == 0
      half_n_pages = n_pages // 2
      firsthalf = list(range(half_n_pages))
      secondhalf = list(reversed(range(half_n_pages, n_pages)))
      # Seen from the top of an UNFOLDED booklet (e.g. a stack of paper that's
      # come out of your printer), "firsthalf" are on the right (from top to
      # bottom: recto facing up, then verso facing down, then recto, then verso)
      # and "secondhalf" are on the left (from top to bottom: verso facing up,
      # then recto facing down, etc.).
      sequence = []  # type: List[int]
      top = True
      for left, right in zip(secondhalf, firsthalf):
          if not top:
              left, right = right, left
          sequence += [left, right]
          top = not top
      if one_based:
          sequence = [x + 1 for x in sequence]
      log.debug("{} sheets => page sequence {!r}", n_sheets, sequence)
      return sequence
docs: Generates the final page sequence from the starting number of sheets.