input: Write a function to generate the first n elements of the Sierpinski triangle. The function should print the elements row by row, with '1' representing filled positions and '0' representing empty positions.
  assert sierpinski_triangle(6)
output: def sierpinski_triangle(n):
      triangle = ['1']
      for i in range(1, n):
          prev_row = triangle[-1]
          new_row = ''
          for j in range(len(prev_row)):
              if j == 0:
                  new_row += '1'
              else:
                  new_row += '1' if prev_row[j] != prev_row[j-1] else '0'
          triangle.append(new_row + '1')
      for row in triangle:
          print(row)