ARITHMETIC BASED FRACTALS ASSOCIATED WITH PASCAL ’ S TRIANGLE

Our goal is to study Pascal-Sierpinski gaskets, which are certain fractal sets defined in terms of divisibility of entries in Pascal’s triangle. The principal tool is a “carry rule” for the addition of the base-q representation of coordinates of points in the unit square. In the case that q = p is prime, we connect the carry rule to the power of p appearing in the prime factorization of binomial coefficients. We use the carry rule to define a family of fractal subsets Bqr of the unit square, and we show that when q = p is prime, Bqr coincides with the Pascal-Sierpinski gasket corresponding to N = p. We go on to describe Bqr as the limit of an iterated function system of “partial similarities”, and we determine its Hausdorff dimension. We consider also the corresponding fractal sets in higher-dimensional Euclidean space. 2000 Mathematics Subject Classification. Primary: 39B12.


Introduction
Just as the Cantor set is obtained from an interval by excising "middle thirds", so is the Sierpinski gasket (or Sierpinski triangle) obtained from a triangle by excising "middle triangles".Starting with a triangle T , we excise the open triangle U 1 with vertices at the midpoints of the three sides of T .This yields T 1 = T \U 1 , which is a union of three congruent triangles each similar to T .Performing the same procedure on each of the three triangles in T 1 , we excise the union U 2 of the three middle triangles.This yields T 2 = T 1 \U 2 , which consists now of nine congruent triangles each similar to T .Iterating the procedure, we obtain in the limit the Sierpinski gasket X as a decreasing limit of the T n 's as n → ∞.If φ 1 , φ 2 , φ 3 are the affine maps of T onto the three triangles in T 1 , then T n+1 = ∪φ j (T n ), and in the limit, X = ∪φ j (X).This relation expresses the self-similarity of X.
It is well known (cf.[Man]) that the Sierpinski gasket can also be obtained by operations on Pascal's triangle.We view Pascal's triangle as a quarter-plane suspended from its vertex and tiled by unit squares, so that each square cell of the tiling contains an entry of Pascal's triangle.We color black the cells with odd entries, and we color white those with even entries.If we scale the triangular figure consisting of the top 2 n rows of Pascal's triangle to fit a fixed triangle, and we let E n be the image of the black squares, we see visually and verify easily that the E n 's decrease to a Sierpinski gasket.
In [H], Holter, Lakhtakia, Varadan, Varadan, and Messier extend this idea by performing the following experiment.For a fixed integer N ≥ 2, they color black the cells of Pascal's triangle whose labels are not divisible by N , the other cells white, they truncate the triangle, and they look for patterns.They observe that when N = p is prime, the truncated and rescaled sets have a limit set that is self-similar and has Hausdorff dimension (1) β p = 1 + log((p + 1)/2) log p .
They report that when N = p r is a power of a prime, "visual inspection alone suffices to show that the resulting gaskets are self-similar", and they raise the problem of determining their dimensions.For N = 6 they report that "visual inspection extended up to n = 198 rows does not reveal any self-similarity in these gaskets".(These sets can be viewed on the interactive web site at http://www.its.caltech.edu/~mamikon/PasFastC.html.)Our goal is to introduce and investigate a family of "fractal" subsets B qr of the plane, defined for integers q ≥ 2 and r ≥ 1, which coincide with the Pascal-Sierpinski gaskets of [H] in the case that q = p is prime and N = p r .We refer to B qr as the (q, r)-basket, since in some sense it is a basket of gaskets.We study the self-similarity properties of B qr , and we determine its Hausdorff dimension.
The paper is organized as follows.In Section 2 we derive the "carry rule", which gives a condition equivalent to a multinomial coefficient being divisible by a fixed prime power p r .In Section 3 we define for each q ≥ 2 the Sierpinski q-gasket B q , we show how it is obtained from a triangle by an iterative process of excising subtriangles, and we collect some basic facts for later use.In Section 4 we define for each q ≥ 2 and r ≥ 1 the (q, r)-basket B qr .The (q, 1)-basket B q1 coincides with the Sierpinski q-gasket B q , and B qr ⊂ B q,r+1 for r ≥ 1.
The carry rule shows that in the case that q = p is prime, B qr coincides with the Pascal-Sierpinski gasket treated in [H] for N = p r .In Section 5 we describe in more detail the dynamics of the (q, r)-basket by showing that B qr can be viewed as a limit of an iterated function system of certain "partial self-similarities".If r > 1, we show that B qr is obtained from B q by plugging scaled copies of lower order gaskets B qt , 1 ≤ t < r, into the triangles forming the complementary components of B q .In Sections 6 and 7 we show that for fixed q, the (q, r)-baskets have Hausdorff dimension β = β q determined by the identity q β = q(q + 1)/2, which is equivalent to the formula (1) with p replaced by q.In Section 8 we indicate how the analysis can be extended to the corresponding fractal sets in higher dimensions and higher order multinomial coefficients.This collaboration began in connection with a project for professional development of K-12 mathematics teachers.We hope that various of the ideas that appear here can be reformulated to be useful for professional development.

The carry rule
We are interested in the prime decompositions of multinomial coefficients.For a given prime number p, we would like to specify the prime power p r appearing in the prime decomposition of a multinomial coefficient.We begin with the following.
Lemma 2.1.Let p be a prime number, and let n ≥ 0. Suppose n has the base-p representation where 0 ≤ a j ≤ p − 1 for 0 ≤ j ≤ k.Then the power p r of p appearing in the prime decomposition of n! has exponent r given by Proof: We may assume n ≥ 1.We express n! = n(n−1)(n−2) . . . .The factors that are divisible by p are the multiples p, 2p, 3p, . . ., (a We count in this fashion, until we reach the number of factors divisible by p k , which is a k .The exponent r is the sum of these numbers, Summing geometric series, we obtain Substituting n−a 0 for a k p k +a k−1 p k−1 +• • •+a 1 p, we obtain the desired identity.
Lemma 2.2.Let p be a prime number, and let m 1 , . . ., m ≥ 0, N = m 1 + • • • + m .Suppose that the m i 's and N have base-p representations m i = j a ij p j , 1 ≤ i ≤ , and N = j b j p j .Then the power p r of p appearing in the prime decomposition of the multinomial coefficient Proof: Apply the preceding lemma to each of the factorials, and use Now we consider the addition algorithm for adding numbers of the form m i = j a ij p j in base-p representation, by adding successively digits in each place and carrying if the sum is ≥ p.We count the carries according to multiplicity.The number of carries in the jth place is the integer κ j ≥ 0 defined inductively, starting with κ −1 = 0, by (4) where 0 ≤ b j ≤ p − 1.
In the case that = 2, we are adding only two m i 's, and there is never more than one carry, that is, each κ j is either 0 or 1.
Theorem 2.3 (Carry Rule).Let p be a prime number, and let m 1 , . . ., m ≥ 0, N = m 1 + • • • + m .Suppose that the m i 's and N have base-p representations m i = j a ij p j , 1 ≤ i ≤ , and N = j b j p j .Then the exponent r in the power p r of p appearing in the prime decomposition of the multinomial coefficient (2) is equal to the number of carries in adding the base-p representations of m i 's.
Proof: From (4) we have i,j Thus from (3) we obtain r = κ j , as required.

The Sierpinski q-gasket
We fix q ≥ 2. For n ≥ 0, let G n be the grid of subsquares of the unit square of sidelength 1/q n .We label the squares according to their lower left corners (x, y), and we represent x and y in their base-q expansions where 0 ≤ x j , y j ≤ q − 1.Let E n be the squares in G n whose labels (x, y) satisfy (5) We refer to the squares in E n as the "black squares", and to the other squares in G n as the "white squares".Let E n be the union of the (closed) black squares in G n , Now consider the corresponding grid G n+1 and black squares E n+1 .The union of the squares in G n+1 with labels (0.x n+1 x n . . .x 2 x 1 , 0.y n+1 y n . . .y 2 y 1 ), taken over 1 ≤ x 1 , y 1 ≤ q − 1, is the square in G n with label (0.x n+1 x n . . .x 2 , 0.y n+1 y n . . .y 2 ).From (5) we see that if a square in G n is white, then each of the constituent squares in G n+1 is also white.Thus {E n } is a decreasing sequence of nonempty compact sets.
Definition 3.1.The Sierpinski q-gasket B q is the decreasing limit of the E n 's, We refer to a square in G n as diagonal if its center lies on the diagonal line {x + y = 1}.Otherwise the square is subdiagonal or superdiagonal depending on whether it lies below-left or above-right of the diagonal squares.Note that the diagonal and subdiagonal squares in G 1 are black (the squares in E 1 ), and the superdiagonal squares in G 1 are white.For each square S ∈ E 1 , we define an affine map φ S of the unit square onto S by scaling by 1/q and translating.If the square S has label (0.a, 0.b), where 0 ≤ a, b ≤ q − 1, then Note that φ S maps the square U in G n with label (0.x n . . .x 1 , 0.y n . . .y 1 ) onto the square V in G n+1 with label (0.ax n . . .x 1 , 0.by n . . .y 1 ).If U is black, then x j + y j ≤ q − 1 for 1 ≤ j ≤ n, so since a + b ≤ q − 1, the square V is also black.Further, if V is a black square in G n+1 , say with label (0.x n+1 x n . . .x 1 , 0.y n+1 y n . . .y 1 ), then V = φ S (U ) for the black square U with label (0.x n . . .x 1 , 0.y n . . .y 1 ) and S with label (0.x n+1 , 0.y n+1 ).Thus and in the limit B q = ∪{φ S (B q ) : S ∈ E 1 }.The maps {φ S } S∈E1 form an iterated function system (see [B], [Men]).The limit B q is the unique fixed point of the set-mapping which is a contraction of the space of nonempty compact subsets of the unit square, endowed with the usual Hausdorff metric.
The Sierpinski q-gasket can also be obtained through an iterative process of excising triangles.We start with the triangle T = {(x, y) : Proof: The squares in E n have labels in T , so points of E n have distance at most 1/2q n from T .Passing to the limit, we obtain B q ⊂ T , and B q is disjoint from W .The squares in G n bordering on the x-axis or the y-axis have labels with one coordinate equal to 0, hence belong to E n .Thus the unit intervals on the two coordinate axes are contained in each E n hence in B q .Also the diagonal squares in G n have labels (x, y) satisfying x j + y j = q − 1, for all j, so the diagonal squares in G n are all black.Thus the diagonal edge of T is contained in each E n , hence in B q .
We consider the q(q − 1)/2 open triangles φ S (W ), where S is subdiagonal.We refer to these as the first-generation triangles.They play the role of the first middle triangle in the construction of the Sierpinski triangle.Let U 1 be the union of the first-generation triangles, and set In each black square S ∈ E 1 we define q(q+1)/2 second-generation triangles to be the triangles in φ S (U 1 ).Thus there are [q(q +1)/2]q(q −1)/2 second-generation triangles.Let U 2 be the union of the second-generation triangles, and let T 2 = T 1 \U 2 .Again U 2 is disjoint from B q , and B q ⊂ T 2 .Proceeding by induction, we define the nth-generation triangles to be the images of the (n − 1)th generation triangles under the maps φ S for S ∈ E 1 .There are [q(q + 1)/2] n−1 q(q − 1)/2 triangles in the nth-generation.The union U n of the nth-generation triangles is disjoint from B q , so that T n = T n−1 \U n contains B q .Passing to the limit, we have On the other hand, T n is contained in the black squares in G n−1 , so that lim T n ⊂ B q .We have established the following.
Theorem 3.3.The Sierpinski q-gasket B q is obtained from the triangle T by excising the nth-generation triangles, 1 ≤ n < ∞, ) .Now we focus on the case when q = p is prime.We consider the quarter-plane tiled by cells that are unit squares containing the entries of Pascal's triangle, and we rotate the quarter-plane so that it fills the first quadrant.With this representation, the entry in the cell whose lower left corner has coordinates (k, m) is the binomial coefficient k+m k , 0 ≤ k, m < ∞.We color the cell white if k+m k is divisible by p, and we color the cell black if k+m k is not divisible by p. Fix n ≥ 0, and consider the square [0, p n ] × [0, p n ].The scaling by the factor 1/p n maps this square onto the unit square, and it maps the cells corresponding to the binomial coefficients onto squares in G n .
Theorem 3.4.Let p be a prime number.Fix n ≥ 1, and 0 ≤ k, m < p n .The binomial coefficient k+m k is not divisible by p if and only if the corresponding square in G n belongs to E n .In other words, the cell in Pascal's triangle corresponding to k+m k is black if and only if the corresponding square in G n is black.
By the carry rule, k+m m is not divisible by p if and only if there are no carries when we add these representations.This occurs if and only if a j + b j ≤ q − 1 for 0 ≤ j ≤ n − 1, and this occurs if and only if the square with label

The (q, r)-basket
Again we fix q ≥ 2, and we let r ≥ 1.Let E rn be the set of squares in G n with labels (x, y) such that when we add the base-q representations of q n−1 x and q n−1 y, there are fewer than r carries.In other words, the squares in E rn are the squares with labels (0.x n x n−1 . . .x 1 , 0.y n y n−1 . . .y 1 ) such that when we add x 1 +x 2 q+• • •+x n q n−1 and y 1 +y 2 q+• • •+y n q n−1 , there are fewer than r carries.Occasionally we refer to the squares in E rn as the "black squares", and we refer to the other squares in G n as the "white squares".Again, if a square in G n is white, then the squares in G n+1 it contains are white.
Let E rn be the union of the (closed) black squares in G n , n=1 is a decreasing sequence of nonempty compact sets.Definition 4.1.The (q, r)-basket B qr is the decreasing limit of the E rn 's, Thus B qr is a nonempty compact subset of the unit square.When r = 1, the definition of E 1n coincides with that of E n , so that E 1n = E n for each n, and the (q, 1)-basket coincides with the Sierpinski q-gasket, If we allow more carries, we obtain more black squares.Thus if r ≤ s, then E rn ⊆ E sn , E rn ⊆ E sn , and in the limit, Figure 3 depicts the fourth stage E 24 in the construction of B 22 (q = 2, r = 2, n = 4).In the lower left quarter we see the preceding stage of the construction.In the upper right quarter we see the third stage of the construction of the Sierpinski gasket (see Figure 1).Now suppose that q = p is prime.We parametrize Pascal's triangle as before, and we consider the cell with coordinates (k, m), which contains the binomial coefficient k+m k .We color the cell white if k+m k is divisible by p r , and we color the cell black if k+m k is not divisible by p r .Again the scaling by the factor 1/p n maps the square {(x, y) : 0 ≤ x, y ≤ p n } onto the unit square, and it maps the cells corresponding to the binomial coefficients onto squares in G n .The following theorem is a direct consequence of the carry rule, as in the preceding section.This shows that B qr is effectively the Pascal-Sierpinski fractal associated in [H] to N = p r .

The dynamics of the black squares
We wish to specify which squares are in E rn in terms of previous stages (smaller values of n or r).We begin with a subdiagonal square T in G 1 , with label (0.a, 0.b).Consider the affine map φ T : [0, 1] 2 → T defined by φ T (x, y) = (0.a, 0.b) + 1 q (x, y), 0 ≤ x, y ≤ 1.
Under φ T there is a one-to-one correspondence of squares in G n−1 and the squares in G n that are contained in T .The square U in G n−1 with label (0.x n−1 . . .x 1 , 0.y n−1 . . .y 1 ) is mapped by φ T to the square V in G n with label (0.ax n−1 . . .x 1 , 0.by n−1 . . .y 1 ).Since T is subdiagonal, a+b ≤ q − 2. Consequently there are the same number of carries when we add the x and y coordinates of U and V .We have established the following.
Lemma 5.1.Let T be a subdiagonal square in G 1 , and let φ T be the affine map from the unit square to T defined above.Then for each n ≥ 1, the squares V in E rn that are contained in T are exactly those squares of the form V = φ T (U ) for squares U in E r,n−1 .
Next fix 1 ≤ t ≤ r, and let T 0 ∈ G t .We say that T 0 is a superdiagonal square of tier t if there is a diagonal square T ∈ G t−1 such that T 0 is a superdiagonal subsquare of T .Suppose the square T 0 has label (0.a 1 . . .a t , 0.b 1 . . .b t ).Then the label of T is (0.a 1 . . .a t−1 , 0.b 1 . . .b t−1 ), and since T is diagonal, a j + b j = q − 1 for 1 ≤ j ≤ t − 1.Since T 0 is a superdiagonal subsquare of T , a t + b t ≥ q.
Suppose n ≥ t, and that V ∈ G n is contained in T 0 .Then the label of V has the form (0.a 1 . . .a t x n−t . . .x 1 , 0.b 1 . . .b t y n−t . . .y 1 ).The affine map φ T0 : [0, 1] 2 → T 0 defined by maps squares in G n−t to squares in G n that are contained in T 0 , and it maps the square U with label (0.x n−1 . . .x 1 , 0.y n−1 . . .y 1 ) onto V .When we add the coordinates of the label of V , we evidently have t more carries than when we add those for U , corresponding to the additional t place values in the coordinates of U .Hence we obtain the following.
Lemma 5.2.Suppose 1 ≤ t ≤ r − 1.Let T 0 be a superdiagonal square of tier t in G t , and let φ T0 be the affine map defined above.Then for each n ≥ t, the squares V in E rn that are contained in T 0 are exactly those squares of the form V = φ T0 (U ) for squares U in E r−t,n−t .
Lemma 5.3.Suppose t ≥ r.Let T 0 be a superdiagonal square of tier t in G t .Then for n ≥ t, T 0 does not contain any squares in E r,n .
To complete the picture, we focus on the subdiagonal part of a diagonal square in G 1 .For this, let S be the sawtooth subset of the unit square that is the union of the diagonal and subdiagonal squares in G r−1 .Let T be a diagonal square in G 1 , let φ T : [0, 1] 2 → T be the usual affine map, and let S T = φ T (S).Then S T is a sawtooth subset of T that is the union of the squares in G r that are either diagonal or subdiagonal subsquares of T .
Lemma 5.4.Let T be a diagonal square in G 1 , let S and S T be the sawtooth sets defined above, and let φ T be the affine map of S onto S T as above.Then for each n ≥ r, the squares V in E rn that are contained in S T are exactly those squares of the form V = φ T (U ) for squares U in E r,n−1 that are contained in S.
Proof: Let V be a square in G n that is contained in S T , and let U be the corresponding square in G n−1 such that V = φ T (U ).Suppose the label of V is (0.x n . . .x 1 , 0.y n . . .y 1 ).Then the label of U is (0.x n−1 . . .x 1 , 0.y n−1 . . .y 1 ).Let W be the square in G r containing V .The label of W is (0.x n x n−1 . . .x n−r+1 , 0.y n y n−1 . . .y n−r+1 ).Since W is a diagonal or subdiagonal square, We consider three cases.Suppose first there is an index k such that n − r + 1 ≤ k ≤ n − 1 and x k + y k ≤ q − 2. Then there are no carries in adding the the values in the kth place or beyond for the labels of both U and V .Consequently the number of carries of U is the same as that for V , and V ∈ E rn if and only if U ∈ E r,n−1 .Suppose next that x j + y j = q − 1 for n − r + 1 ≤ j ≤ n − 1, and there is no carry from the (n − r)th place in adding the labels of U or V .Then there are no carries in adding the values beyond the (n − r)th place for the labels of both U and V .Again the number of carries for U is the same as that for V , and V ∈ E rn if and only if U ∈ E r,n−1 .Suppose finally that x j + y j = q − 1 for n − r + 1 ≤ k ≤ n − 1, and there is a carry from the (n − r)th place in adding the labels of U or V .Then there are carries for both U and V in each place from the (n − r)th place to the (n − 1)th place.Thus there are at least r carries for both U and V , and consequently U / ∈ E r,n−1 , V / ∈ E r,n .Since these three cases cover all possibilities, we conclude that V ∈ E rn if and only if U ∈ E r,n−1 .This proves the lemma.
These three lemmas allow us to describe the part of the (q, r)-basket B qr lying above the diagonal in terms of the scaled baskets for smaller values of r.
Theorem 5.5.Let r ≥ 2 and 1 ≤ t ≤ r − 1.Let T 0 be a superdiagonal square of tier t.Then the limit of the squares in E rn contained in T 0 is the (q, r − t)-bucket B q,r−t , scaled by 1/q t .Thus the part of (q, r)-bucket B qr to the upper right of the diagonal {x + y = 1} is a union of scaled (q, t)-buckets, 1 ≤ t ≤ r − 1, and a row of triangles adjacent to the diagonal.Each of the triangles is the half of a diagonal square in G r−1 to the upper right of the diagonal.In the case q = 2 and r = 4, Figure 4  Now recall that B q is obtained from the triangle T by excising the nth-generation triangles for n ≥ 1.Let V be a first-generation triangle.Then V is the superdiagonal of a subdiagonal square S. Let φ S be the affine map of the unit square onto S, so that V = φ S (W ).Then φ S (W ∩ B qr ) = V ∩ B qr , so that the part of B qr in V can be viewed as obtained by plugging a scaled copy of W ∩ B qr into V .Similarly, an nth-generation triangle has the form where S 1 ∈ E 1 is subdiagonal, and S 2 , . . ., S n ∈ E 1 .Again V ∩ B qr is the image of W ∩ B qr under this composition, so that the part of B qr in V can be viewed as obtained by plugging a scaled copy of W ∩ B qr into V .We have established the following.
Theorem 5.6.Let W be the upper triangle in the unit square, as before.Let r ≥ 2, and let X = B qr ∩ W .The (q, r)-basket B qr is obtained from the Sierpinski q-gasket B q by plugging scaled copies of X into each of the nth-generation triangles in U n , n ≥ 1.

Counting the black squares
Let R r (n) denote the number of squares in E rn , that is, the number of black squares at the nth stage.The black-square count will provide us with one route to determine the Hausdorff dimension of B qr .Since all squares are black when n < r, we are only interested in finding R r (n) for n ≥ r.Theorem 6.1.Fix q ≥ 2, and let r ≥ 1.There is a polynomial P r (n) in n of degree r − 1 such that Further, Proof: We have already observed in Section 4 that R 1 (n) = [q(q+1)/2] n .Hence the theorem holds for r = 1, and in this case P 1 = 1.Thus we assume that r ≥ 2, and we make an induction hypothesis that ( 8) q(q + 1) 2 where the big-oh term in ( 8) is a polynomial in n of degree ≤ k − 2. We assume n ≥ r, and we count black squares.There are q(q − 1)/2 subdiagonal squares in G 1 .In view of Lemma 5.1, we see that each of these contains R r (n − 1) squares in E rn .Thus there are a total of ( 9) squares of E rn contained in the subdiagonal squares of G 1 .Let S r (n) denote the number of superdiagonal squares in E rn .Each such square is in tier t for some 1 ≤ t ≤ r − 1.There are q t−1 diagonal squares in G t−1 , and each of these contains q(q − 1)/2 superdiagonal subsquares in G t .Thus there are a total of q t (q − 1)/2 superdiagonal squares in tier t.In view of Lemma 5.2, we see that each of these contains R r−t (n − t) squares in E rn .Thus There are S r (n − 1) superdiagonal squares in E r,n−1 , so there are R r (n − 1) − S r (n − 1) diagonal and subdiagonal squares in E r,n−1 .There are q diagonal squares in G 1 , so that in view of Lemma 5.4 we see that there are (11) qR r (n − 1) − qS r (n − 1) squares of E rn contained in the diagonal squares of G 1 .

Hausdorff dimension
Let E be a subset of R d , and let s > 0. For each δ > 0, let Λ (δ) s (E) denote the infimum of the sums r s j , taken over all covers of E by balls with radii r j satisfying r j ≤ δ.As δ decreases, the infimum is taken over fewer covers, and Λ (δ) s (E) is the s-dimensional Hausdorff measure of E. The Hausdorff dimension of E is the infimum of s such that Λ s (E) = 0.For background information on Hausdorff measures, see [R].
Proof: Let δ = 1/q n .Each square in E rn is contained in a disk of radius δ.Using Theorem 6.1, we obtain Since this tends to 0 as n → ∞, Λ s (B qr ) → 0 as δ → 0, and Λ s (B qr ) = 0.
Fix q ≥ 2 and associated grids G n .For E a subset of the unit square [0, 1] 2 in R 2 , define where the infimum is taken over all finite covers of E by sets G j ∈ ∪G n .
It is easy to see that there are constants c, C > 0 such that s (E), for all compact subsets E of the unit square (though not for arbitrary subsets).We aim to compute λ Lemma 7.3.Let U ∈ E r,n−1 .Then either all q 2 subsquares of U in G n are contained in E rn , or exactly q(q + 1)/2 of the subsquares of U in G n are contained in E rn .
Proof: Let U have label (0.a n . . .a 2 , 0.b n . . .b 2 ).Subsquares U 0 of U then have labels of the form (0.a n . . .a 2 a 1 , 0.b n . . .b 2 b 1 ).Since U ∈ E r,n−1 , there are at most r − 1 carries when we add the coordinates of U .Define k, 0 ≤ k ≤ q − 1, so that k = 1 if a 2 + b 2 = q − 1, and otherwise k is the largest integer such that a j + b j = q − 1 for 2 ≤ j ≤ k.For a subsquare U 0 with label as above, there are no new carries if a 1 + b 1 ≤ q − 1, while there are k more carries for U 0 if a 1 + b 1 ≥ q.If now the number of carries for U is < r − k, then all subsquares U 0 have < r carries, and all q 2 subsquares belong to E rn .If on the other hand the number of carries for U is ≥ r − k, then the subsquares U 0 with < r carries are precisely the subsquares for which a 1 + b 1 ≤ q − 1, and there are exactly q(q + 1)/2 such subsquares, namely the diagonal and subdiagonal subsquares.
B rq , we conclude that the infimum defining λ (δ) β (B qr ) is attained for the cover E rn .
The remaining assertions of the theorem follow from the definitions of R r (n) and P r (n) and Theorem 6.1.
Proof: The first statement follows from Theorem 7.4 and the comparability of λ (δ) s and Λ (δ) s .For the second statement, suppose first that r = 2.By Theorem 5.6, B q2 is obtained from B q by plugging scaled copies of B q into the complementary triangles of B q .In this construction, there are q(q − 1)/2 triangles with scaling factor 1/q, and at the nth stage there are [q(q + 1)/2] n−1 q(q − 1)/2 triangles with scaling factor 1/q n .Thus the β-dimensional Hausdorff measure of the copy of B q plugged in to the triangles at the nth stage is ∼ 1/q nβ , and Thus B q2 has infinite though σ-finite β-dimensional Hausdorff measure.If now r > 2, B qr is the union of B q and a countable number of scaled copies of B qt for t < r.By induction on r, we see that B qr has infinite though σ-finite β-dimensional Hausdorff measure.
Note that the fact that B qr has σ-finite β-dimensional Hausdorff measure already implies that Λ s (B qr ) = 0 for s > β.This provides another route to Theorem 7.1, which depends only on the (easy) case r = 1 of Theorem 6.1.In any event, we have the following corollary to Theorem 7.5.

Baskets in higher dimensions
We can define baskets in d-dimensional Euclidean space for any d ≥ 2 in the same way as in the two-dimensional case.Carrying over the same notation, we let G n be the grid of subcubes of the unit cube [0, 1] d of sidelength 1/q n , and we label a cube in G n by the d-tuple of coordinates of its lower left corner.We express the coordinates in base-q, and we define E rn to be the subset of G n of cubes with the property that when we add the coordinates of the label, there are fewer than r carries.Again we define E rn be the union of the (closed) cubes in E rn .The E rn 's form a decreasing sequence of nonempty compact sets.We define their limit to be the (q, r)-basket in R d , and we denote it by B qr .
If r = 1, we obtain the analogue B q = B q1 in R d of the Sierpinski q-gasket.It is the limit of the iterated function system consisting of functions of the form where k = (k 1 , . . ., k d ), and the k j 's are nonnegative integers satisfying Each k/q is the label of a diagonal or subdiagonal cube in G 1 .In this case there are q d−1 (q + 1)/2 cubes in E 1 , hence [q d−1 (q + 1)/2] n cubes in E n .Consequently This has a finite nonzero limit as n → ∞ when q β = q d−1 (q + 1) 2 , that is, for β = β q defined by β q = d − 1 + log((q + 1)/2) log q .
It is straightforward to verify that β q is the Hausdorff dimension of B q .Again B q has finite positive β q -dimensional Hausdorff measure, and for r ≥ 2, B qr has infinite though σ-finite β q -dimensional Hausdorff measure.
In the case that q = p r is a prime power, there is a connection between the (q, r)-basket and the d-dimensional analogue of Pascal's triangle consisting of multinomial coefficients.The connection can be made through the following theorem, which is a direct consequence of the carry rule.
Theorem 8.1.Let p be a prime number, and let r ≥ 1.For n ≥ 1 and 0 ≤ k 1 , . . ., k d < p n , the multinomial coefficient is not divisible by p r if and only if the cube in G n with label q −n (k 1 , . . ., k d ) belongs to E rn .

Figure 2 .
Figure 2. Two stages E 1 , E 2 in construction of B 3 .

Figure 3 .
Figure 3. Fourth stage E 24 in construction of B 22 .

Theorem 4. 2 .
Let p be a prime number, and let r ≥ 1. Fix n ≥ 1, and 0 ≤ k, m < p n .The binomial coefficient k+m k is not divisible by p r if and only if the corresponding square in G n belongs to E rn .In other words, the cell in Pascal's triangle corresponding to k+m k is black if and only if the corresponding square in G n is black.
qr ) explicitly.First we prove two lemmas.Lemma 7.2.If U is a (closed) square in E rn , then B qr contains interior points of U .Proof: If U∈ E rn has label (0.a n . . .a 2 a 1 ,0.b n . . .b 2 b 1 ), then (0.a n . . .a 2 a 1 10, 0.b n . . .b 2 b 1 01) is an interior point of U .From the definition of E rn , we see that it labels a square in E rk for all k ≥ n + 2, hence it belongs to B qr .
• •+m .Let the m i 's have base-p representations m i = j a ij p j as above.Then p does not divide the multinomial coefficient (2) if and only if there are no carries in adding the base-p representations of the m i 's, that is, if and only if a 1j + a 2j + • • • + a j < p for j ≥ 0.