# Tag Info

5

Using ArrayPad + Fold + Nest + MatrixPlot ClearAll[padMat] padMat = Fold[ArrayPad[#, RotateLeft[{{0}, {Length @ #, 0}}, #2 - 1], 1 + Max @ #] &, #, {1, 2}] &; Examples: With[{n = 6}, MatrixPlot[Nest[padMat, {{1}}, n] /. x_Integer :> ColorData[x], ImageSize -> 600, Frame -> False, Mesh -> All]] Grid @ Partition[#, 3] & @ ...

4

We can also use affine transformations of the unit rectangle to get the desired picture: ClearAll[rectangleCoords] rectangleCoords[n_] := Module[{mod = Mod[Range[0, n - 2], 2], sy = 2^Floor[Range[0, n - 2]/2], rcoords = {{0, 0}, {1, 1}}}, Through[(Reverse @ Prepend[Identity][AffineTransform[{{{#, 0}, {0, #2}}, {##3}}] & @@@ (Transpose[{(1 + ...

1

We can also recursively divide the bottom-right rectangle into three rectangles as follows: ClearAll[threerects, step, rectlist] threerects = # /. Rectangle[{a_, b_}, {c_, d_}] :> {Rectangle[{a, (b + d)/2}, {c, d}], Rectangle[{a, b}, {a + c, b + d}/2], Rectangle[{(a + c)/2, b}, {c, (b + d)/2}]} &; Graphics[MapIndexed[{{Red, Green,...

Only top voted, non community-wiki answers of a minimum length are eligible