Next Article in Journal
Mathematical Modeling and Parameter Estimation of Lane-Changing Vehicle Behavior Decisions
Previous Article in Journal
Ricci Semi-Symmetric Robertson–Walker Spacetime in f(R)-Gravity
 
 
Font Type:
Arial Georgia Verdana
Font Size:
Aa Aa Aa
Line Spacing:
Column Width:
Background:
Article

Counting the Number of Squares of Each Colour in Cyclically Coloured Rectangular Grids

Department of Mathematics & Statistics, University of Guelph, Guelph, ON N1G 2W1, Canada
Mathematics 2025, 13(6), 1013; https://doi.org/10.3390/math13061013
Submission received: 13 February 2025 / Revised: 18 March 2025 / Accepted: 19 March 2025 / Published: 20 March 2025

Abstract

:
Modular arithmetic is used to apply generalized C-coloured checkerboard patterns to m × n gridded rectangles, ensuring that colours cycle both horizontally and vertically. This paper yields methods for counting the number of squares of each colour, which is a nontrivial combinatorial problem in discrete geometry. The main theorem provides a closed-form expression for a sum of floor functions, representing the count of squares for each colour. Two proofs are presented: a heuristic, constructive approach dividing the problem into sub-cases, and a purely mathematical derivation that transforms the floor sum into a closed-form solution, computable in O ( 1 ) operations, independent of m , n and C. Numerical counts are validated using a brute-force procedure in MATLAB (Version 9.14, R2023a).

1. Introduction and Motivation

A key problem in polyomino tiling theory is to tile a finite subset of the plane, called the target region, using a given set of polyominoes. Polyominoes are polyforms composed of edge-connected unit squares. A black and grey checkerboard colouring of the polyominoes and target region is necessary for an integer linear programming (ILP) approach that improves the scalability of the tiling method [1]. This method requires us to determine the number of black and grey squares in the target region. For a rectangular target region, a simple formula provides these counts [2]. The general formula for the number of black squares (b) and grey squares (g) in an m × n checkerboard rectangle is given by
b = m n + p 2 , g = m n p 2 ,
where p, the “parity” of the checkerboard region, is the difference between the number of black and grey squares. For a rectangle, p = 0 if m n is even and ± 1 if m n is odd. Another checkerboard pattern for the 9 × 13 rectangle is obtained by swapping the colours (when m n is odd, the checkerboard variant with a black square in the top-left corner has parity + 1 , while the variant with a grey square in the top-left corner has parity 1 ). For example, the checkerboard coloured 9 × 13 rectangle in Figure 1 contains 59 black squares and 58 grey squares.
This paper generalizes the enumeration problem of counting the squares of each colour to a C-coloured checkerboard m × n rectangle, which is a nontrivial problem in combinatorial and discrete mathematics. We use modular arithmetic to generate the checkerboard pattern, ensuring that the coloured squares cycle both vertically and horizontally (see Section 2 for a rigorous development). Our approach reformulates the combinatorial geometry problem [3] as an equivalent number-theoretic problem involving a sum of floor functions.
Enumeration problems in discrete geometry have been widely studied in combinatorics. Classical topics include counting lattice points in polytopes, tiling problems with constraints, and enumeration in structured partitions of the plane. Grünbaum and Shephard’s comprehensive work [4] systematically classifies plane tilings and their symmetry properties, establishing fundamental results for periodic and aperiodic tilings. Stanley’s text [5] develops key techniques for enumerative combinatorics, including generating functions and the transfer-matrix method, which provide powerful tools for counting discrete structures. Ziegler [6] presents a thorough treatment of polytope theory, covering face lattices, shellability, and enumeration of faces, which connects to various problems in discrete geometry.
Modular arithmetic methods, such as those used in divisor sums and residue class enumeration, also play an important role in combinatorial number theory [7]. However, the specific problem of counting cyclically coloured squares in finite grids, as formulated in this paper, does not appear to have been studied before.
We introduce our enumeration problem with an illustrative example. Applying six colours cyclically to a 9 × 13 rectangle produces six distinct variants. Given any one variant, the remaining five variants are generated by cyclically shifting the colours. The variant with a black square in the top-left corner is shown in Figure 2.
This paper is part of an ongoing research project that generalizes the ILP approach in [1] for polyomino tiling problems. Additional details are given in Appendix B.
Starting from a modular arithmetic formulation of the colouring procedure, the main goal of this paper is to derive a closed-form solution for enumerating coloured squares in a generalized C-coloured checkerboard m × n rectangle. Colours are represented by indices x { 1 , 2 , , C } . Our approach yields the following expression for the colour counts:
g ( x ) = i = 1 m i + ( n x 1 ) C + i = 1 m i + x C + m ,
where the notation z represents the largest integer less than or equal to z (the “floor function”). Thus, to find a closed-form solution for the colour counts, we derive closed-form solutions to the sum of floor functions of the form:
i = 1 m ± i + b c , m , c N and b Z .
Research on sums involving floor functions is a popular area of study. Foundational work on floor and ceiling sums is found in the book “Concrete Mathematics” by Graham, Knuth, and Patashnik [8], which provides an in-depth treatment of these sums, such as finding an expression for
0 k < m n k + x m , integer m > 0 , integer n ,
and their applications in various mathematical contexts. Further research has produced closed-form solutions for a variety of other floor sum forms [9,10,11,12,13,14].
It is worth noting that an alternative graph-theoretic perspective exists for addressing similar counting problems by considering the grid as a planar graph whose unit squares correspond to its faces. Classical results on face colourability demonstrate that an Eulerian planar graph is two-face colourable [15], whereas extending such results to three or more colours requires more sophisticated techniques. Although group-theoretic methods (cf. Pólya’s Enumeration Theorem [16]) can theoretically be applied to study such cyclic colourings, our approach using modular arithmetic provides a direct computational method that yields closed-form solutions while avoiding the complexities of advanced graph invariants and group actions.
The rest of this paper is structured as follows. In Section 2, we describe the rigorous mathematical procedure needed to apply a generalized C-coloured checkerboard pattern to rectangular grids. Section 3 presents a constructive proof for counting coloured squares, including an example and corollaries for specific cases. In Section 4, we introduce two lemmata for the sum of floor functions, which are needed for the main theorem. Section 5 provides the main result: a closed-form solution for counting coloured squares in rectangular grids. Finally, Section 6 concludes the paper, summarizing our findings and suggesting directions for future work. In the appendices, we list the MATLAB code used to validate the theoretical counts and give additional details concerning the relevance of the current paper to integer linear programming.

2. Modular Arithmetic Approach to Colouring Grids

To develop a systematic approach for applying a generalized C-coloured checkerboard pattern to rectangular grids, we first establish the mathematical framework using modular arithmetic.
Definition 1. 
The gridded m × n rectangle is the union of unit squares forming an m × n rectangle, given by
R m × n : = 1 i ˜ m , 1 j ˜ n [ j ˜ 1 , j ˜ ] × [ i ˜ 1 , i ˜ ] .
Our goal is to develop a consistent and systematic procedure for colouring the squares of R m × n , using an arbitrary, but finite, number of colours.
Definition 2. 
The finite m × n grid is a subset of Z 2 given by
Z m × n 2 : = { ( j ˜ , i ˜ ) 1 i ˜ m , 1 j ˜ n } .
The first step in the colouring procedure is to define a function h : R m × n Z m × n 2 given by
h ( x , y ) : = ( x , y ) ,
which maps every point in a square [ j ˜ 1 , j ˜ ] × [ i ˜ 1 , i ˜ ] to its top right-hand corner with coordinates ( j ˜ , i ˜ ) Z m × n 2 . Here, the notation z represents the smallest integer greater than or equal to z (the “ceiling function”). Thus, each square in R m × n is uniquely identified with integer coordinates ( j ˜ , i ˜ ) .
Definition 3. 
A colour index is a unique integer from the set { 1 , 2 , , C } assigned to each of the C colours ( C 2 ).
Colours are assigned to the squares of R m × n using a cyclic permutation ( 1 2 C ) , an element of the symmetric group S C [17], ensuring that the colour indices cycle left-to-right and bottom-to-top.
A simple formula for generating the colour indices of the squares in the rectangle is as follows:
s 1 ( j ˜ , i ˜ ) : = ( i ˜ + j ˜ ) ( mod C ) + 1 , for   1 i ˜ m , 1 j ˜ n .
We have a “ + 1 ” in this formula so the indices increment from 1 to C instead of 0 to C 1 , which is more intuitive when counting colours.
There are C possible coloured variants of R m × n , obtained by cycling the colour indices. To obtain a mathematical expression for these checkerboard-coloured variants, indexed by k, we generalize the function s 1 in (3) via
s k ( j ˜ , i ˜ ) = ( i ˜ + j ˜ + k 1 ) ( mod C ) + 1 , for   k = 1 , 2 , , C , for   1 i ˜ m , 1 j ˜ n .
Observe that when k = 1 (4) reverts to (3). As we will represent coloured rectangles using matrices, we wish the colour indices to cycle left-to-right and top-to-bottom. To flip the order of colour indices vertically we apply a change in variable in the ordinate of the function s 1 ( j ˜ , i ˜ ) via
j = j ˜ and   i = C + 1 i ˜ .
This effectively changes the coordinates from ( j ˜ , i ˜ ) in the Cartesian system to ( i , j ) in the matrix system (we could have only used the matrix coordinates, but an initial introduction of the Cartesian coordinates allows the colouring procedure to be rigorously defined).
In practical computations coloured rectangles are stored as matrices. This leads to the following definition.
Definition 4. 
The k-th colour matrix associated with a colouring of the rectangle R m × n , denoted by A = ( a i , j ) , is defined by
a i , j = s k ( j , i ) , f o r   k { 1 , 2 , , C } ,
where 1 i m and 1 j n .
Remark 1. 
For counting coloured squares it is sufficient to select a single one of the C variants of R m × n . We choose the variant with a colour index “1” in the top left-hand corner of the rectangle. The remaining C 1 variants are obtained by cycling the colour indices of the squares.
Definition 5. 
A C-coloured checkerboard rectangle, denoted R m × n C , is a colouring of the squares of the gridded m × n rectangle using Equations (2) and (4). Furthermore, the parameter k in (4) is chosen so that the colour index of the square in the top left-hand corner of R m × n is “1”.
Using Definitions 4 and 5 we determine the specific colour matrix we use by identifying which of the k-coloured variants satisfies the requirements of Definition 5.
Proposition 1. 
The C-coloured checkerboard coloured rectangle R m × n C is represented by the colour matrix A = ( a i , j ) , where
a i , j = ( i + j 2 ) ( mod C ) + 1 , f o r   1 i m , 1 j n .
Proof. 
From Definition 4, the elements of the colour matrices for the C-coloured variants of the target region are represented by
a i , j = s k ( j , i ) , for   k = 1 , 2 , , C , for   1 i m , 1 j n .
To enforce the requirement that a 1 , 1 = 1 in Definition 5, Equation (6) yields
a 1 , 1 = s k ( 1 , 1 ) = 1 ( k + 1 ) ( mod C ) = 0 k = C 1 .
Substituting this value of k back into (6) yields the desired result.    □
Remark 2. 
In the sequel, unless stated otherwise, the term “C-coloured checkerboard rectangle” refers to the ( C 1 ) -th coloured variant, i.e., we assume k = C 1 (see Remark 1).
Example 1. 
The 10 × 13 rectangle with C = 4 colours is illustrated in Figure 3 and its colour matrix in (7).
A = 1 2 3 4 1 2 3 4 1 2 3 4 1 2 3 4 1 2 3 4 1 2 3 4 1 2 3 4 1 2 3 4 1 2 3 4 1 2 3 4 1 2 3 4 1 2 3 4 1 2 3 4 1 2 3 4 1 2 3 4 1 2 3 4 1 2 3 4 1 2 3 4 1 2 3 4 1 2 3 4 1 2 3 4 1 2 3 4 1 2 3 4 1 2 3 4 1 2 3 4 1 2 3 4 1 2 3 4 1 2 3 4 1 2 3 4 1 2 3 4 1 2 3 4 1 2 3 4 1 2

3. A Constructive Proof for Counting Coloured Squares

We provide a constructive proof with heuristic elements for counting how many coloured squares of each colour are in a C-coloured checkerboard m × n rectangle. The proof of this result was outlined on the mathematics stream of StackExchange [18], a public question-and-answer website. As this result is unpublished and the user requested that they remain anonymous, we provide a rigorous theorem and proof below.
Theorem 1. 
Consider a C-coloured checkerboard m × n rectangle, where C 2 , n , m , C N . We assume m , n C . Using the Euclidean Division Lemma ([7], Theorem 2.1), let a and b, 0 a , b C 1 , be the unique remainders when m and n are divided by C, i.e., a = m ( mod C ) and b = n ( mod C ) . We assume the top-left square has colour index “1”. If a b = 0 then the number of squares of each colour is given by m n / C . If, however, a b 0 , then the number of coloured squares with index x { 1 , 2 , , C } is given by the function:
f ( x ) = N + a + b C i f x a + b 1 C , N + x i f a + b 1 C < x < min ( a , b ) , N + min ( a , b ) i f min ( a , b ) x max ( a , b ) , N + a + b x i f max ( a , b ) < x a + b 1 , N i f x > a + b 1 ,
where
N : = m n a b C N .
Proof. 
Partition the m × n rectangle into four smaller rectangles, with dimensions ( m a ) × ( n b ) , a × ( n b ) , ( m a ) × b , and a × b , illustrated in Figure 4. Now due to the division lemma, C ( n b ) and C ( m a ) , thus C [ ( n b ) m + b ( m a ) ] . However, ( n b ) m + b ( m a ) = m n a b , thus C ( m n a b ) . As a consequence, if at least one side of the rectangle is divisible by C (i.e., a = 0 or b = 0 ) the number of squares of each colour in the m × n rectangle is exactly m n / C .
The rest of this proof is for the case when C does not divide m or n, i.e., a b 0 . In this case, we need an expression for how many squares of each colour are in the “remainder” a × b rectangle, which we then add to the counts ( m n a b ) / C for each colour.
To derive an expression for colour counts in the a × b rectangle, we count indices for each colour diagonally (south-west to north-east) starting from the index x = 1 in the top-left corner of the rectangle. Let x denote a variable that counts how far along half the perimeter we have traversed as we count the diagonal indices in the a × b rectangle, so x { 1 , 2 , , a + b 1 } . An example of this counting procedure is illustrated in Figure 5. Observe that the general pattern for the index counts in a diagonal is h ( x ) = x , until x = min ( a , b ) , which occurs when the diagonal includes the lower left corner of the a × b rectangle if a < b , or the upper left corner of the a × b rectangle if b < a (and if a = b , the diagonal includes both corners). For min ( a , b ) < x max ( a , b ) , the index counts in a diagonal remain a constant value of min ( a , b ) .
Then for max ( a , b ) < x a + b 1 , the index counts decrease until h ( a + b 1 ) = 1 . The general form is h ( x ) = k x , k N , so we deduce that h ( x ) = a + b x in this interval. Note that if x > a + b 1 then we are no longer within the a × b rectangle and so the diagonal count is zero. Thus, to summarize, the diagonal counts can be split into four intervals:
h ( x ) = x if   x < min ( a , b ) , min ( a , b ) if min ( a , b ) x max ( a , b ) , a + b x if max ( a , b ) < x a + b 1 , 0 if   x > a + b 1 ,
The endpoints are chosen so that each index x belongs to just one interval.
We now need total counts for the indices representing colour, and so we need to determine if a colour with index x can belong to more than one interval. To answer this we consider when x = x + j C where j N . Note that if j = 2 , i.e., x = x + 2 C it is easily verified from the assumptions on a , b and x, that x + 2 C > a + b 1 , and so we have left the region of the a × b rectangle, and so we need only consider the case x = x + C . Notice that if x + C a + b 1 we must have x a + b 1 C . Observe that a + b 1 C min ( a , b ) + max ( a , b ) 1 C < min ( a , b ) + max ( a , b ) + 1 C min ( a , b ) + ( C 1 ) + ( 1 C ) = min ( a , b ) , so we are in the first interval. Furthermore, as it follows immediately that x + C > max ( a , b ) and we assume x + C a + b 1 , this yields max ( a , b ) < x + C a + b 1 , i.e., colours with index x in the first interval are repeated in the third interval, with counts h ( x + C ) and so the total (combined) contribution for x in the first interval satisfying x a + b 1 C is
x + h ( x + C ) = x + [ a + b ( x + C ) ] = a + b C .
Thus, putting this all together, the contributions for each colour with index x in the a × b rectangle satisfy the following:
g ( x ) = a + b C if   x a + b 1 C , x if   a + b 1 C < x < min ( a , b ) , min ( a , b ) if min ( a , b ) x max ( a , b ) , a + b x if max ( a , b ) < x a + b 1 , 0 if   x > a + b 1 .
Adding these contributions to N (see (9)) yields the desired result.    □
Example 2. 
Consider the problem of colouring the 13 × 19 rectangle with 5 colours. Using (9), we have N = 47 and (8) yields f ( 1 ) = f ( 2 ) = 49 , f ( 3 ) = f ( 4 ) = 50 and f ( 5 ) = 49 .
The C = 2 case leads to Corollary 1, which is also stated in [2] in a slightly different form.
Corollary 1. 
Consider a 2-coloured checkerboard m × n rectangle, m , n 2 . Let f ( x ) denote the number of squares with colour index x { 1 , 2 } . Then f ( x ) is given by the function
f ( x ) = m n 2 if m n is even , m n 1 2 + δ x , 1 if m n is odd , f o r   x { 1 , 2 } ,
where δ x , n is the Kronecker delta function, which equals 1 if x = n and 0 otherwise.
Proof. 
First observe that the values of a and b are restricted to 0 or 1. We know that if a = 0 or b = 0 , i.e., a b = 0 then f ( x ) = m n / 2 for x = 1 and 2. Thus, the possible values of a and b that we need to consider are when a = b = 1 , i.e., a b = 1 . Elementary calculations using (8) yields the following results:
f ( x ) = m n a b 2 + 0 if a b = 0   and   x { 1 , 2 } , 1 if a b = 1   and   x = 1 , 0 if a b = 1   and   x = 2 ,
which is equivalent to (12).    □
The C = 3 case leads to Corollary 2.
Corollary 2. 
Consider a 3-coloured checkerboard m × n rectangle, m , n 2 , with a = m ( mod 3 ) and b = n ( mod 3 ) . Let f ( x ) denote the number of squares with colour index x { 1 ,   2 ,   3 } . Then f ( x ) is given by
f ( x ) = m n a b 3 + 0 if a b = 0 , δ x , 1 if a b = 1 , δ x , 1 + δ x , 2 if a b = 2 , 1 + δ x , 2 if a b = 4 , f o r   x { 1 , 2 , 3 } ,
where δ x , n is the Kronecker delta function, which equals 1 if x = n and 0 otherwise.
Proof. 
First observe that the values of a and b are restricted to 0, 1, or 2. We know that if a = 0 or b = 0 , i.e., a b = 0 then f ( x ) = m n / 3 for x = 1 , 2 , and 3. Thus, the possible values of a and b that we need to consider are (i) when a = b = 1 , i.e., a b = 1 ; (ii) when either a = 1 and b = 2 , or when a = 2 and b = 1 , i.e., a b = 2 ; and (iii) when a = b = 2 , i.e., when a b = 4 . Furthermore, as x can take three values this yields nine sub-cases to consider. Tedious but elementary calculations using (8) yields the following results:
f ( x ) = m n a b 3 + 0 if a b = 0   and   x { 1 , 2 , 3 } , 1 if a b = 1   and   x = 1 , 0 if a b = 1   and   x = 2 , 0 if a b = 1   and   x = 3 , 1 if a b = 2   and   x = 1 , 1 if a b = 2   and   x = 2 , 0 if a b = 2   and   x = 3 , 1 if a b = 4   and   x = 1 , 2 if a b = 4   and   x = 2 , 1 if a b = 4   and   x = 3 ,
which is easily verified to be equivalent to (13).    □
A similar approach yields expressions for the colour counts in the C 4 cases. However, the number of sub-cases in the counts increases rapidly with increasing C. Determining the number of sub-cases is essentially the “multiplication table problem of Erdos” (the number of distinct products a b for a , b { 1 , 2 , , N } is given by sequence A027424 from the On-line Encyclopedia of Integer Sequences (OEIS) [19]).
Remark 3. 
Theorem 1 has several drawbacks. Firstly, the proof splits the problem into several sub-cases, resulting in a piecewise-defined solution. Secondly, the arguments includes heuristic elements due to intuitive geometric reasoning. Finally, the conditions of the theorem exclude the possibility that m or n equals 1, as it assumes m , n C 2 , which was necessary for the partitioning and diagonal counting methods used in the proof. For these reasons, the remainder of the paper is devoted to deriving a purely mathematical solution for the colour counts that avoids these limitations.

4. Two Lemmata for the Sum of Floor Functions

The following two lemmata are necessary for proving a theorem given in Section 5.
Lemma 1. 
Given m , c N and a Z the sum
S = i = 1 m i + a c
can be expressed in the following closed-form
S = 1 2 ( k 1 l 1 ) 2 ( 1 + a ) + c ( 1 + k 1 + l 1 ) + l 1 m ,
where
k 1 : = 1 + a c a n d l 1 : = m + a c .
Brief proof overview: The key observation is that the increasing sequence of floor values exhibits a periodic pattern. We begin by determining how often the initial and final values occur within the finite sequence. In between, the floor values increase steadily before decreasing, effectively forming an arithmetic progression. By partitioning the sequence into three segments—beginning, middle, and end—we sum the contributions of each part separately. This structured breakdown ultimately leads to the closed-form expression presented in Lemma 1.
Proof. 
The approach here is similar to the proof of a related result for Lemma 1 in [10]. The infinite sequence
i + a c i = +
follows a predictable pattern, repeating every c terms, where the integers in each complete group of c terms are one more than the integers in the previous group. The terms in this increasing sequence are represented by
, 3 , 3 , , 3 c terms , 2 , 2 , , 2 c terms , 1 , 1 , , 1 c terms , 0 , 0 , , 0 c terms , 1 , 1 , , 1 c terms , 2 , 2 , , 2 c terms , 3 , 3 , , 3 c terms ,
As we have a finite (truncated) series of terms
i + a c i = 1 m
in the sum, the first and last group of integers in this series repeat a total of n times, where n { 1 , 2 , , c } . We identify the contributions to S from the first term, the middle terms, and the last term in the sequence. To this end we need to identify the first and last terms of this sequence and the number of times they occur. The first and last integers in the finite series are given by
k 1 : = 1 + a c and l 1 : = m + a c ,
respectively. For example, with m = 11 , a = 5 , and c = 4 , the terms of the sequence are
1 , 1 , 2 , 2 , 2 , 2 , 3 , 3 , 3 , 3 , 4
i.e., k 1 = 1 and l 1 = 4 occur two and one time, respectively.
To find the number of times the first term k 1 appears, we determine the smallest i such that
i + a c = k 1 + 1 .
Solving for i:
i + a c k 1 + 1 i c ( k 1 + 1 ) a .
Therefore, the number of times k 1 appears is
n start = c ( k 1 + 1 ) a 1 ,
and the contribution from the first term is k 1 · n start . To find the number of times the last term l 1 appears we determine the largest i such that
i + a c = l 1 1 .
Solving for i:
i + a c < l 1 i < c l 1 a .
Therefore, the number of times l 1 appears is
n end = m ( c · l 1 a ) + 1 ,
and the contribution from the last term is l 1 · n end . Now consider the middle terms. The number of middle terms is m n start n end . However, each integer is repeated c times, so we have an arithmetic series repeated c times. The number of terms in each arithmetic series is therefore
N = m n start n end c ,
where n start and n end are defined as above.
The sum of an arithmetic series with first term a 1 , common difference d, and n terms is
S = n 2 2 a 1 + ( n 1 ) d .
For our problem,
a 1 = k 1 + 1 , d = 1 , n = N .
Therefore, the sum of the middle terms is
S middle = c · N 2 2 ( k 1 + 1 ) + ( N 1 ) .
Adding the contributions from the first term, middle terms, and last term yields
S = k 1 · n start + c · N 2 2 ( k 1 + 1 ) + ( N 1 ) + l 1 · n end .
Simplifying this expression using SymPy, a Python (version 3.11.8) library for symbolic mathematics [20], yields the expression (15), as required.    □
Lemma 2. 
Given m , c N and a Z the sum
S = i = 1 m i + a c
can be expressed in the following closed-form:
S = 1 2 ( k 2 l 2 ) 2 ( a m ) + c ( 1 + k 2 + l 2 ) + l 2 m ,
where
k 2 = a m c a n d l 2 = a 1 c .
Brief proof overview: We apply a change of variable that reverses the order of summation, thereby transforming the original decreasing sequence into an equivalent form that mirrors the increasing sequence considered in Lemma 1. This reformulation allows us to directly apply the formula in Lemma 1, yielding the desired closed-form expression.
Proof. 
The groups of c integers in the sum exhibit a similar pattern to those in Lemma 1, but form a decreasing sequence. Instead of deriving the closed-form solution from first principles we simplify the proof by applying a change of variable to reverse the order of summation. This transformation converts the sum into the same form as the sum in (14), allowing us to directly apply the closed-form solution given in (15). Let j = m i + 1 then i = 1 corresponds to j = m and i = m corresponds to j = 1 . Substituting j into the sum (16) yields
S = j = m 1 j m + a 1 c = j = 1 m j m + a 1 c = j = 1 m j + b c ,
where b : = a m 1 . As the sum is now in the form (14), applying (15) yields
S = 1 2 ( k 2 l 2 ) 2 ( 1 + b ) + c ( 1 + k 2 + l 2 ) + l 2 m , = 1 2 ( k 2 l 2 ) 2 ( a m ) + c ( 1 + k 2 + l 2 ) + l 2 m ,
where
k 2 = 1 + b c = a m c a n d l 2 = m + b c = a 1 c ,
as required.    □

5. A Closed-Form Solution for Counting Squares in Rectangular Grids

We present the main result, which is a closed-form solution for the colour counts in R m × n C . The proof of the theorem is based on Lemmata 1 and 2 and the following lemma regarding how many elements of a given colour index are in particular row of the colour matrix A.
Lemma 3. 
Consider a colour matrix A = ( a i , j ) associated with a C-coloured checkerboard m × n rectangle R m × n C . The number of elements in the i-th row with a colour index x { 1 , 2 , , C } is given by
r i ( x ) = i + ( n x 1 ) C + x i C + 1 .
Proof. 
We use the following rules of congruences, which can be found in any elementary text on number theory, e.g., [7]:
(i)
a = b ( mod c ) b = a ( mod c ) ,
(ii)
a = b ( mod c ) a + d = b + d ( mod c ) ,
(iii)
a = b ( mod c ) a b = k c for some integer   k ,
where a, b, c, and d are integers, and c 1 . Suppose a i , j = x , i.e., the ( i , j ) -th entry of the colour matrix A has the colour index x. We consider i fixed and j freely varying across its range. From Proposition 1 we have
( i + j 2 ) ( mod C ) + 1 = x .
For a fixed row i we wish to find how many integers j satisfy this equation. The rules of congruences yield
( i + j 2 ) ( mod C ) = x 1 i + j 2 = ( x 1 ) ( mod C ) j = ( 1 i + x ) ( mod C ) .
Furthermore, we need to find how many integers t there are such that j = 1 i + x + t C . As 1 j n , we have
1 1 i + x + t C n i x C t i + ( n x 1 ) C .
So we need to count the number of integers in the closed interval from ( i x ) / C to ( i + ( n x 1 ) ) / C . Using the fact that the number of integers in the interval [ α , β ] is β α + 1 , for all real α and β ([8], p. 74), the number of integers is given by
i + ( n x 1 ) C i x C + 1 .
Using the identity γ = γ for all real γ ([8], p. 68) the result follows.    □
Example 3. 
Consider the colour matrix
A = 1 2 3 1 2 3 1 2 3 1 2 3 1 2
associated with the 3-coloured checkerboard 2 × 7 rectangle illustrated in Figure 6. From (18), the number of squares in the i-th row of A with colour index x, where x { 1 ,   2 ,   3 } , is given by
r i ( x ) = i + 6 x 3 + x i 3 + 1 .
For example:
number of black squares in row 1 = r 1 ( 1 ) = 3 , number of red squares in row 2 = r 2 ( 3 ) = 2 .
The following theorem is the main result of this paper.
Theorem 2. 
Consider a C-coloured checkerboard m × n rectangle R m × n C , where C 2 , n , m , C N . The number of squares with colour index x { 1 , 2 , , C } is given by the function
g ( x ) = 1 2 ( k 1 l 1 ) 2 ( x n ) + C ( 1 + k 1 + l 1 )
+ 1 2 ( k 2 l 2 ) 2 ( m x ) + C ( 1 + k 2 + l 2 ) + m ( 1 + l 1 + l 2 ) ,
where k 1 : = n x C , l 1 : = m + n x 1 C ,
k 2 : = x m C , l 2 : = x 1 C .
Proof. 
Using Lemma 3 and noting that 1 i m , the total number of squares in a C-coloured checkerboard m × n rectangle with colour index x is given by
i = 1 m r i ( x ) = i = 1 m i + ( n x 1 ) C + x i C + 1 .
We write this as
g ( x ) = i = 1 m i + ( n x 1 ) C + i = 1 m i + x C + m .
Applying Lemmata 1 and 2 to the first and second sums in (20), respectively, yields the solution (19), as required.    □
Example 4. 
Consider the colour matrix
A = 1 2 3 4 5 1 2 3 4 5 1 2 3 4 5 1 2 3
associated with the 5-coloured checkerboard 3 × 6 rectangle illustrated in Figure 7.
Using the closed-form solution (2) yields
number of black squares = g ( 1 ) = 4 , number of grey squares = g ( 2 ) = 4 , number of red squares = g ( 3 ) = 4 , number of green squares = g ( 4 ) = 3 , number of yellow squares = g ( 5 ) = 3 .
Figure 7. A 5-coloured checkerboard pattern applied to the 3 × 6 rectangle, where the colour indices 1, 2, 3, 4, and 5 represent the colours black, grey, red, green, and yellow, respectively.
Figure 7. A 5-coloured checkerboard pattern applied to the 3 × 6 rectangle, where the colour indices 1, 2, 3, 4, and 5 represent the colours black, grey, red, green, and yellow, respectively.
Mathematics 13 01013 g007
Finally, we derive a formula for obtaining the colour counts for the general k-th checkerboard coloured variant, as the counts g ( x ) in Theorem 2 are for the k = ( C 1 ) -th variant (see Equation (4) and Proposition 1). To obtain the colour counts for a general variant, observe that, as the colour indices cycle up, the colour counts shift forward cyclically, yielding:
If   k = 1 ,   we have the counts   g ( C 1 ) , g ( C ) , g ( 1 ) , , g ( C 2 ) . If   k = 2 ,   we have the counts   g ( C 2 ) , g ( C 1 ) , g ( C ) , g ( 1 ) , , g ( C 3 ) . If   k = 3 ,   we have the counts   g ( C 3 ) , g ( C 2 ) , g ( C 1 ) , g ( C ) , g ( 1 ) , , g ( C 4 ) . If   k = C 1 ,   we have the counts   g ( 1 ) , g ( 2 ) , , g ( C ) . If   k = C ,   we have the counts   g ( C ) , g ( 1 ) , , g ( C 1 ) .
We illustrate this pattern in the following example:
Example 5. 
Consider three different 6-coloured checkerboard 4 × 3 rectangles for k = 5 , k = 6 , and k = 1 (see Figure 8). The colours used are black, grey, red, green, yellow, and blue, represented by the colour indices 1, 2, 3, 4, 5, and 6, respectively. Each time the colours cycle up by one colour, represented diagrammatically by
b l a c k g r e y r e d g r e e n y e l l o w b l u e ( b l a c k , e t c . ) ,
the variants increment, i.e., the k-th variant becomes the ( k + 1 ) -th variant, and the corresponding colour counts shift forward cyclically, as shown in Table 1.
Proposition 2 provides the generalized form of this example.
Proposition 2. 
Consider a C-coloured checkerboard m × n rectangle, where C 2 , n , m , C N . The number of coloured squares for the k-th checkerboard coloured variant (see (4)), where k { 1 , 2 , , C } , is given by the function
h k ( x ) = g ( ( x k 2 ) ( mod C ) + 1 ) f o r   x = 1 , 2 , , C ,
where g ( x ) is defined in (19).
Proof. 
We use proof by induction. Let P ( r ) be the statement that (21) is true for k = r . Consider P ( C 1 ) :
h C 1 ( x ) = g ( ( x ( C 1 ) 2 ) ( mod C ) + 1 ) = g ( ( x 1 ) ( mod C ) + 1 ) = g ( x ) ,
for x = 1 , 2 , , C , as required. Assume that P ( r ) is true. Now observe that h r + 1 ( x ) = h r ( x 1 ) , i.e., as r increments by one unit the corresponding colour counts shift forward by one unit because the modular arithmetic ensures that the values wrap around cyclically. Thus, P ( r ) holds for all r { 1 , 2 , , C } .    □
Remark 4. 
It is instructive to contrast the computational work required to enumerate colour counts for different approaches. A brute-force method iterates over each square in the m × n rectangle, computing the colour indices with the formula a i , j = ( i + j 2 ) ( mod C ) + 1 (see Proposition 1) in O ( m n ) operations. The sum in Equation (20) is computed in O ( m ) operations. In contrast the formula in Theorem 2 needs O ( 1 ) operations, i.e., a fixed number of arithmetic operations, independent of m , n and C. Thus from a computational perspective the formula in Theorem 2 is simpler than a brute-force approach or the sum in Equation (20).
Remark 5. 
We used MATLAB (Version 9.14, R2023a) to numerically verify the closed-form solutions in Theorems 1 and 2 (details omitted). We compared the theoretical colour counts with numerical counts obtained via brute-force enumeration using MATLAB (see Appendix A). Many cases were checked for various values of m, n, and C.

6. Conclusions and Future Work

This paper derived closed-form solutions for counting coloured squares in m × n rectangular grids with a generalized C-coloured checkerboard pattern. The colour indices were represented by a colour matrix A = ( a i , j ) , given by
a i , j = ( i + j 2 ) ( mod C ) + 1 , where 1 i m , 1 j n .
The enumeration problem of counting the number of squares of each colour was converted into an equivalent problem involving sums of floor functions, where each sum has the form
i = 1 m ± i + b c , m , c N and b Z .
We presented a method for finding a closed-form solution for the floor sums, which then led to a closed-form solution for the counts of coloured squares.
We also provided a MATLAB function using a brute-force method to numerically validate the theoretical counts (see Appendix A).
Future work could focus on deriving closed-form solutions for the counts of coloured squares in C-coloured checkerboard shapes other than rectangles, such as “Aztec diamond shapes”, “parallelogram shapes”, or “diamond shapes” (see the families of polyomino shapes in Table A1 of [2]).
Alternatively we could investigate counting coloured squares in more general C-coloured patterns applied to rectangles. For example, consider the modular arithmetic formulation of the “generalized” colour matrix A = ( a i , j ) defined by
a i , j = ( s i + t j 2 ) ( mod C ) + 1 , where 1 i m , 1 j n ,
and s and t are integers. For example, using C = 4 colours applied to the 7 × 11 rectangle with s = 2 and t = 5 yields the pattern in Figure 9, which is quite different from the coloured checkerboard patterns. Unlike the basic checkerboard arrangement, where the colour index increments are the same in both the horizontal and vertical directions, this generalized pattern employs different constant shifts across rows and down columns. These distinct step sizes yield a more intricate design, illustrating the flexibility of the modular arithmetic approach beyond simple cyclic patterns.
The methods in this paper convert this more general counting problem into an equivalent formulation involving the sum of floor functions, where each sum is of the form
i = 1 m a i + b c , m , c N and a , b Z .
Finding a closed-form solution to this sum is more challenging than the corresponding sum in (22) and will require additional strategies. Moreover, exploring these patterns could uncover interesting links between mathematics and art, as the aesthetically pleasing design in Figure 9 demonstrates.
Future work may also explore concrete applications of our enumeration techniques in computer graphics and discrete geometry. For instance, although Efros and Leung’s [21] non-parametric texture synthesis method relies on neighbourhood sampling to generate new textures, our closed-form expressions could be employed to analyze and constrain the underlying tiling configurations, thereby enhancing the efficiency of synthesis algorithms. Moreover, in discrete geometry, where similar counting problems arise in lattice point enumeration [5], our results may provide new insights into the combinatorial structure of geometric configurations.
Another promising research direction involves exploring the connections between cyclically coloured rectangular grids and graph labeling problems. In our work, we use modular arithmetic to derive closed-form expressions for counting coloured squares—a technique that mirrors modular-based labeling approaches in graph theory. For instance, Alkasasbeh et al. [22] recently applied similar ideas to the radio labeling of friendship communication networks, demonstrating that modular constraints can be used to obtain efficient bounds and algorithms for frequency assignment problems. Investigating these links further could yield new insights into colouring algorithms in both discrete geometry and graph theory, thereby enhancing our understanding and opening up practical applications in computer graphics and theoretical computer science.

Funding

This research received no external funding.

Institutional Review Board Statement

Not applicable.

Informed Consent Statement

Not applicable.

Data Availability Statement

The original contributions presented in this study are included in the article. Further inquiries can be directed to the corresponding authors.

Acknowledgments

We gratefully acknowledge Rajesh Pereira (University of Guelph, Canada) for helpful suggestions on the Proof of Lemma 1. Laurence Garvie (Arizona State University, USA) provided valuable feedback on English language editing, and Allan Willms (University of Guelph, Canada) contributed useful corrections. We are also grateful to the anonymous referees for their careful corrections and valuable suggestions that improved this paper.

Conflicts of Interest

The authors declare no conflicts of interest.

Key Symbols and Notation

The following symbols and notation are used in this manuscript:
CNumber of colours in the checkerboard pattern
R m × n Gridded m × n rectangle (a polyomino)
Z m × n 2 Finite m × n grid as a subset of Z 2
( j ˜ , i ˜ ) Integer Cartesian coordinates of a grid square
s k ( j ˜ , i ˜ ) Colour index function for the k-th checkerboard variant
i , j Matrix coordinates of the colour matrix
A = ( a i , j ) Colour matrix representing the C-coloured checkerboard rectangle
R m × n C C-coloured checkerboard rectangle
xColour index in the range { 1 , 2 , , C }
f ( x ) Function giving the number of squares of colour index x (see Theorem 1)
r i ( x ) Number of elements with colour index x in the i-th row of A (see Lemma 3)
g ( x ) Closed-form function for the number of squares of colour index x (see Theorem 2)
h k ( x ) Colour count function for the k-th checkerboard variant (see Proposition 2)

Appendix A. MATLAB Code for Colouring Rectangles

The following MATLAB code defines a function that generates and visualizes a colour matrix for an m-by-n rectangle using the ( C 1 ) -th coloured variant. It uses modular arithmetic to assign colours from the set { 0 , 1 , 2 , , C } to the rectangle’s cells and plots the result using predefined RGB colour mappings.
Mathematics 13 01013 i001

Appendix B. Application to an ILP-Based Tiling Method

Although our results are primarily theoretical, they are directly relevant to our ongoing research that aims to generalize an ILP techniques for tiling problems [1]. The method first imposes a fixed C-colour checkerboard pattern on the target region and then enumerates the distinct checkerboard-coloured polyominoes (called chrominoes) associated with each polyomino. In the initial ILP model, one variable is introduced per chromino, with constraints ensuring that the total counts of coloured squares in the target region match the sum of the corresponding coloured squares from the selected chrominoes. This step reduces the search space by eliminating infeasible chromino sets before considering tile placements. Solving this model yields a feasible set of chrominoes that may form a tiling.
Next, a second ILP model is built, assigning a variable to each valid placement of these chrominoes in the target region. It ensures that every chromino is placed in a way that fully covers the region while preserving the checkerboard colouring and satisfying the prescribed counts from the first model. Since the first model filters out many infeasible chromino sets, it reduces the number of placement variables required in the second model. This is useful because the general problem of determining whether a region can be tiled with polyominoes is NP -complete [23] and becomes computationally expensive as the problem size grows. By reducing the overall ILP size one can often achieve faster solve times with optimizers like CPLEX [24] or Gurobi [25], though the extent of these performance gains depends on the number of colours C, the problem structure, and solver heuristics.

References

  1. Garvie, M.R.; Burkardt, J. A Parallelizable Integer Linear Programming Approach for Tiling Finite Regions of the Plane with Polyominoes. Algorithms 2022, 15, 164. [Google Scholar] [CrossRef]
  2. Garvie, M.R.; Burkardt, J. A New Algorithm Based on Colouring Arguments for Identifying Impossible Polyomino Tiling Problems. Algorithms 2022, 15, 65. [Google Scholar] [CrossRef]
  3. Pach, J.; Agarwal, P.K. Combinatorial Geometry; Wiley-Interscience: New York, NY, USA, 1995. [Google Scholar] [CrossRef]
  4. Grünbaum, B.; Shephard, G. Tilings and Patterns; W.H. Freeman and Company: New York, NY, USA, 1987; Chapter 9. [Google Scholar]
  5. Stanley, R.P. Enumerative Combinatorics, 2nd ed.; Cambridge University Press: New York, NY, USA, 2011; Volume 1. [Google Scholar] [CrossRef]
  6. Ziegler, G. Lectures on Polytopes, 7th ed.; Graduate Texts in Mathematics; Springer: New York, NY, USA, 1995; Volume 152. [Google Scholar] [CrossRef]
  7. Burton, D. Elementary Number Theory, 7th ed.; McGraw-Hill: New York, NY, USA, 2011. [Google Scholar]
  8. Graham, R.L.; Knuth, D.E.; Patashnik, O. Concrete Mathematics: A Foundation for Computer Science, 2nd ed.; Addison-Wesley: Reading, MA, USA, 1994. [Google Scholar]
  9. Griffiths, M. More Sums Involving the Floor Function. Math. Gaz. 2002, 86, 285–287. [Google Scholar] [CrossRef]
  10. Palatsanga, W.; Pongsriiam, P.; Khemaratchatakumthorn, T.; Subwattanachai, K.; Khuntijit, N.; Kitnaka, N. Remarks on certain sums involving floor function. Sci. Asia 2021, 47, 640–644. [Google Scholar] [CrossRef]
  11. Podrug, L.; Svrtan, D. Some refinements of formulae involving floor and ceiling functions. Math. Commun. 2023, 28, 303–316. [Google Scholar]
  12. Bordellès, O. On certain sums of number theory. Int. J. Number Theory 2022, 18, 2053–2074. [Google Scholar] [CrossRef]
  13. Stucky, J. The fractional sum of small arithmetic functions. J. Number Theory 2022, 238, 731–739. [Google Scholar] [CrossRef]
  14. Zhang, W. On general sums involving the floor function with applications to k-free numbers. Lith. Math. J. 2023, 63, 547–556. [Google Scholar] [CrossRef]
  15. West, D.B. Introduction to Graph Theory; Prentice Hall: Urbana, IL, USA, 2001; Volume 2. [Google Scholar]
  16. Pólya, G. Kombinatorische Anzahlbestimmungen für Gruppen, Graphen und chemische Verbindungen. Acta Math. 1937, 68, 145–254. [Google Scholar]
  17. Ledermann, W.; Weir, A.J. Introduction to Group Theory, 2nd ed.; Longman Mathematical Series; Addison Wesley Longman Ltd.: New York, NY, USA, 1996. [Google Scholar] [CrossRef]
  18. Garvie, M.R. How Many Squares of Each Colour Are in a Generalized C-Coloured m × n Rectangle? Mathematics Stack Exchange. 2022. Available online: https://math.stackexchange.com/questions/4439271/how-many-squares-of-each-colour-are-in-a-generalized-checkerboard-c-coloured (accessed on 1 March 2025).
  19. OEIS Foundation Inc. Sequence A027424. Available online: https://oeis.org/A027424 (accessed on 1 March 2025).
  20. Meurer, A. SymPy: Symbolic Computing in Python, Version 1.8. 2024. Available online: https://www.sympy.org/en/index.html (accessed on 1 March 2025).
  21. Efros, A.A.; Leung, T.K. Texture Synthesis by Non-parametric Sampling. In Proceedings of the Seventh IEEE International Conference on Computer Vision, Corfu, Greece, 20–27 September 1999; pp. 1033–1038. [Google Scholar] [CrossRef]
  22. Alkasasbeh, A.H.; Badr, E.; Attiya, H.; Shabana, H.M. Radio Number for Friendship Communication Networks. Mathematics 2023, 11, 4232. [Google Scholar] [CrossRef]
  23. Demaine, E.; Demaine, M. Jigsaw Puzzles, Edge Matching, and Polyomino Packing: Connections and Complexity. Graphs Comb. 2007, 23, 195–208. [Google Scholar] [CrossRef]
  24. IBM ILOG. IBM ILOG CPLEX Optimization Studio. 2025. Available online: https://www.ibm.com/products/ilog-cplex-optimization-studio (accessed on 1 March 2025).
  25. Gurobi Optimization, LLC. GUROBI 12.0. 2024. Available online: https://www.gurobi.com/ (accessed on 1 March 2025).
Figure 1. A 2-colour checkerboard pattern applied to the 9 × 13 rectangle with 59 black squares and 58 grey squares.
Figure 1. A 2-colour checkerboard pattern applied to the 9 × 13 rectangle with 59 black squares and 58 grey squares.
Mathematics 13 01013 g001
Figure 2. A 6-colour checkerboard pattern applied to the 9 × 13 rectangle with 20 black, grey, and red squares, and 19 green, yellow, and blue squares.
Figure 2. A 6-colour checkerboard pattern applied to the 9 × 13 rectangle with 20 black, grey, and red squares, and 19 green, yellow, and blue squares.
Mathematics 13 01013 g002
Figure 3. A 4-coloured checkerboard 10 × 13 rectangle. The colour indices 1, 2, 3, and 4 represent the colours black, grey, red, and green, respectively.
Figure 3. A 4-coloured checkerboard 10 × 13 rectangle. The colour indices 1, 2, 3, and 4 represent the colours black, grey, red, and green, respectively.
Mathematics 13 01013 g003
Figure 4. Using the Euclidean Division Lemma to partition the m × n rectangle into four smaller rectangles.
Figure 4. Using the Euclidean Division Lemma to partition the m × n rectangle into four smaller rectangles.
Mathematics 13 01013 g004
Figure 5. Index counts: (a) indices x for the diagonally coloured squares of an a × b rectangle where a = 4 and b = 5 ; (b) index counts h ( x ) yielding the number of diagonal squares associated with x .
Figure 5. Index counts: (a) indices x for the diagonally coloured squares of an a × b rectangle where a = 4 and b = 5 ; (b) index counts h ( x ) yielding the number of diagonal squares associated with x .
Mathematics 13 01013 g005
Figure 6. A 3-coloured checkerboard pattern applied to the 2 × 7 rectangle, where the colour indices 1, 2, and 3 represent the colours black, grey, and red, respectively.
Figure 6. A 3-coloured checkerboard pattern applied to the 2 × 7 rectangle, where the colour indices 1, 2, and 3 represent the colours black, grey, and red, respectively.
Mathematics 13 01013 g006
Figure 8. Three 6-coloured checkerboard 4 × 3 rectangles. The colour indices 1, 2, 3, 4, 5, and 6 represent the colours black, grey, red, green, yellow, and blue, respectively. (a) k = 5 -th variant, (b) k = 6 -th variant, (c) k = 1 -st variant.
Figure 8. Three 6-coloured checkerboard 4 × 3 rectangles. The colour indices 1, 2, 3, 4, 5, and 6 represent the colours black, grey, red, green, yellow, and blue, respectively. (a) k = 5 -th variant, (b) k = 6 -th variant, (c) k = 1 -st variant.
Mathematics 13 01013 g008
Figure 9. A 4-coloured pattern applied to the 7 × 11 rectangle using a “generalized” modular arithmetic formulation. The colours black, grey, red, and green are represented by the indices 1, 2, 3, and 4, respectively.
Figure 9. A 4-coloured pattern applied to the 7 × 11 rectangle using a “generalized” modular arithmetic formulation. The colours black, grey, red, and green are represented by the indices 1, 2, 3, and 4, respectively.
Mathematics 13 01013 g009
Table 1. The table shows the colour counts h k ( x ) for variants k = 5 , 6 , 1 with colour indices x { 1 , 2 , 3 , 4 , 5 , 6 } .
Table 1. The table shows the colour counts h k ( x ) for variants k = 5 , 6 , 1 with colour indices x { 1 , 2 , 3 , 4 , 5 , 6 } .
k h k ( 1 ) h k ( 2 ) h k ( 3 ) h k ( 4 ) h k ( 5 ) h k ( 6 )
5123321
6112332
1211233
Disclaimer/Publisher’s Note: The statements, opinions and data contained in all publications are solely those of the individual author(s) and contributor(s) and not of MDPI and/or the editor(s). MDPI and/or the editor(s) disclaim responsibility for any injury to people or property resulting from any ideas, methods, instructions or products referred to in the content.

Share and Cite

MDPI and ACS Style

Garvie, M.R. Counting the Number of Squares of Each Colour in Cyclically Coloured Rectangular Grids. Mathematics 2025, 13, 1013. https://doi.org/10.3390/math13061013

AMA Style

Garvie MR. Counting the Number of Squares of Each Colour in Cyclically Coloured Rectangular Grids. Mathematics. 2025; 13(6):1013. https://doi.org/10.3390/math13061013

Chicago/Turabian Style

Garvie, Marcus R. 2025. "Counting the Number of Squares of Each Colour in Cyclically Coloured Rectangular Grids" Mathematics 13, no. 6: 1013. https://doi.org/10.3390/math13061013

APA Style

Garvie, M. R. (2025). Counting the Number of Squares of Each Colour in Cyclically Coloured Rectangular Grids. Mathematics, 13(6), 1013. https://doi.org/10.3390/math13061013

Note that from the first issue of 2016, this journal uses article numbers instead of page numbers. See further details here.

Article Metrics

Back to TopTop