input: def sierpinski_triangle(n):
      """
      Generate the first n rows of the Sierpinski triangle using bit patterns.
      The triangle is drawn by alternating '1's and '0's for each row with specific patterns.
      
      >>> sierpinski_triangle(3)
          1 
        1 0 1 
      1 0 0 0 1 
      >>> sierpinski_triangle(1)
      1 
      """
output:     rows = []
      for i in range(n):
          row = ''
          for j in range(i + 1):
              if j == 0 or j == i:
                  row += '1 '
              else:
                  row += '0 '
          rows.append(row.strip())
      
      max_length = len(rows[-1])
      for row in rows:
          print(row.center(max_length))