Sometimes you can tell a question is probably going to be deleted, but it’s fun to look for an answer anyway… This is one of those cases, the question was deleted but here is the answer:
This link should cover your needs. J.M. wrote a nice compact function to create the Sierpinski triangle:
Weak question with no effort sometimes getting removed. We sent a message to OP with recommendations and links. But you already have posted an answer and it is great so we keep it. Thanks!