%\title{The first six levels of the Sierpinski triangle}
% From http://tex.stackexchange.com/a/119604
%
% For a collection of beautiful variations on this theme, see
% http://www.oftenpaper.net/sierpinski.htm
%
\documentclass[border=5mm]{standalone}
\usepackage{tikz}
\usetikzlibrary{lindenmayersystems}
\begin{document}%
\def\trianglewidth{2cm}%
\pgfdeclarelindenmayersystem{Sierpinski triangle}{
\symbol{X}{\pgflsystemdrawforward}
\symbol{Y}{\pgflsystemdrawforward}
\rule{X -> X-Y+X+Y-X}
\rule{Y -> YY}
}%
\foreach \level in {0,...,5}{%
\tikzset{
l-system={step=\trianglewidth/(2^\level), order=\level, angle=-120}
}%
\begin{tikzpicture}
\fill [black] (0,0) -- ++(0:\trianglewidth) -- ++(120:\trianglewidth) -- cycle;
\draw [draw=none] (0,0) l-system
[l-system={Sierpinski triangle, axiom=X},fill=white];
\end{tikzpicture}
}%
\end{document}