OFFSET
1,1
COMMENTS
The Sierpinski carpet is constructed starting from the unit square, and removing in the next iteration the middle piece of the square cut into 3 X 3 smaller squares. The same operation is applied to each square not yet removed, in subsequent iterations.
At the n-th iteration, the initial unit square is subdivided in 3^n X 3^n smaller squares. The present sequence gives the numbers (from 1 to 9^n) of the newly removed subsquares, cf. examples.
The n-th row has A001018(n) = 8^n terms.
LINKS
M. F. Hasler, Table of n, a(n) for n = 1..585
Wikipedia, Sierpinski carpet
EXAMPLE
At the first iteration, the middle square, which is the 5th of the 9 squares, is removed, so the first row reads [5]. This leaves 9 - 1 = 8 squares.
At the next iteration, in each of the 8 remaining squares, each one subdivided into 3 X 3 smaller squares, the middle square is removed. The numbers of these subsquares are 11, 14 and 17 in the second row, 38 and 44 in the middle row, and 65, 68 and 71 in the penultimate row, so row 2 = [11, 14, 17, 38, 44, 65, 68, 71]. (The subsquares are numbered from 1 to 81, i.e., all of the 9 X 9 subsquares, including the "empty" ones, get a number. Otherwise said, the number of a square equals (y-1)*3^n+x, if x,y are the coordinates both ranging from 1 to 3^n.)
This leaves 8*9 - 8 = 8*(9 - 1) = 64 "nonempty" squares. Therefore, the next row has 64 terms. The first 9 of these correspond to the 2nd, 5th, 8th, ... square of the 2nd row, i.e., numbers 29, 32, ..., 53, in steps of 3. The next two terms are the numbers of the 2nd and not the 5th, but the 8th square of the 5th row, thus 4*27 + 2 = 110 and 116.
PROG
(PARI) {A293834_row(n, B=[0], u=vector(8, i, 1))=for(k=2, n, my(v=vector(8, j, if(j>3, if(j>5, j-6+2*3^k, j*2-8+3^k), j-1))); B=concat(apply(t->t*u+v, B+B\3^k*3^k*2))*3); apply(t->t+3^n+2, Set(B))}
CROSSREFS
KEYWORD
nonn
AUTHOR
M. F. Hasler, Oct 16 2017
STATUS
approved