Sierpinski Carpet
Last updated at February 26, 2026 by Teachoo
Transcript
Pattern of Squares & Holes in Sierpinski Carpet We can figure the Math behind the pattern. We use two variables to track what is happening at any given step (๐ ): ๐น_๐ : The number of Remaining squares. ๐ฏ_๐ : The number of Holes created. Finding ๐น_๐ (Remaining Squares) Every time you move to the next step, you take one square and turn it into eight smaller squares (because you removed the 9th one in the middle). Step 0: 1 square ( ๐ _0=1 ) Step 1: 1 ร 8=8 squares ( ๐ _1=8 ) Step 2: 8 ร 8=64 squares ( ๐ _2=8^2 ) General Formula: ๐น_๐=๐^๐ Finding ๐ฏ_๐ (Holes) Every remaining square from the previous step generates exactly one new hole in the current step. And of course, you keep all the old holes you already made. Step 0: 0 holes ( ๐ป_0=0 ) Step 1: The 1 square from Step 0 creates 1 hole. ( ๐ป_1=1 ) Step 2: The 8 squares from Step 1 create 8 new holes. Add the 1 old hole. ( ๐ป_2=1+8 ) Step 3: The 64 squares from Step 2 create 64 new holes. Add the older holes. ( ๐ป_3=1+8+8^2 )