[Math] Sierpinski triangle formula: How to take into account for 0th power

fractalsgeometry

The formula to count Sierpinski triangle is 3^k-1 .It is good if you don't take the event when k=0.But how can you write a more precise formula that takes the k=0 into account which gives 3^-1?Just to note, I did figure out the equation myself as I learned it to write a program although the equation is available online.I am doing it purely for fun and out of curiosity, no homework question.

Add-on:

I tried to draw a tree to find the relation but still the nodes start to show pattern from level 2.enter image description here

Best Answer

As I understand it, you want a formula to count the number $n$ of triangles that remain at level $k$ in the standard trema construction of the Sierpinski triangle. If we say that level one is the initial triangle, then that leads to a sequence of images that looks like so:

enter image description here

We can then clearly see your formula: $n=3^{k-1}$. (Recall that $3^0=1$, so that $k=1$ yields the correct result.) This depends, however, on where you choose to start counting. I would personally prefer to call the initial triangle level zero but, really, this is somewhat arbitrary.

One other comment: I'm not sure why you're using an unbalanced binary tree to model this situation. It seems to me that a balanced ternary tree (where each node has three children) would be more natural.