I would need to create a Sierpinski triangle in LaTeX, with numbers in the triangles.
As follows:
I have tried to modify the following code:
\begin{figure}[h] \centering \begin{tikzpicture}[scale=2] \def\trianglewidth{2cm}% \pgfdeclarelindenmayersystem{Sierpinski triangle}{ \symbol{X}{\pgflsystemdrawforward} \symbol{Y}{\pgflsystemdrawforward} \rule{X -> X-Y+X+Y-X} \rule{Y -> YY} }% \tikzset { l-system={step=\trianglewidth/(2^6), order=6, angle=-120} } \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} \caption{Sierpiński Sieve.} \label{fig:SierpinskiTriangle} \end{figure} But without success :( How can I write numbers in the triangles??

