SierpinskiCurve
SierpinskiCurve[n] gives the line segments representing the nth-step Sierpiński curve.
Examples
First few iterations:
Graphics[SierpinskiCurve[3]]Higher resolution:
Graphics[SierpinskiCurve[5], AspectRatio -> Automatic]Animate the curve development:
Table[Graphics[SierpinskiCurve[n]], {n, 1, 6}]Please visit the official Wolfram Language Reference for more details.