cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

A381517 Perimeter of the Sierpiński carpet at iteration n.

Original entry on oeis.org

4, 16, 80, 496, 3536, 26992, 212048, 1684720, 13442768, 107437168, 859182416, 6872514544, 54977282000, 439809752944, 3518452514384, 28147543587568, 225180119118032, 1801440264196720, 14411520047331152, 115292154179921392, 922337214843187664, 7378697662956950896, 59029581136289955920, 472236648588222693616
Offset: 0

Views

Author

Jakub Buczak, Feb 26 2025

Keywords

Comments

Carpet n has an overall size 3^n X 3^n and the perimeter here includes the perimeter of all holes within it.
Carpet n=0 is a unit square and has perimeter a(0) = 4.
Carpet n can be constructed by arranging 8 copies of carpet n-1 in a square with a hole in the middle,
X X X
X X
X X X
There are no gaps in each side so 2 sides of each n-1 are now not on the perimeter so a(n) = 8*a(n-1) - 16*3^(n-1).
An equivalent construction is to replace each of the 8^(n-1) unit squares of carpet n-1 with a 3 X 3 block of unit squares with a hole in the middle, so that a(n) = 3*a(n-1) + 4*8^(n-1).
A fractal is obtained by scaling the whole carpet down to a unit square and its scaled perimeter a(n)/3^n -> oo shows the perimeter is infinite even though the area is bounded.

Examples

			For n=0, a(0) = 4, the geometric representation is a square.
For n=3, a(3) = 496.
		

Crossrefs

Cf. A113210 (fractal dimension).

Programs

  • Python
    a = lambda n: (4 * (4 * 3**n + 8**n)) // 5

Formula

a(n) = (4/5)*(4*3^n + 8^n).
a(n) = A365606(n+1) - 4.