Sierpinski triangle - A Sierpinski square-based pyramid and its &#39;inverse&#39;