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

Modular arithmetic is used to apply generalized <i>C</i>-coloured checkerboard patterns to <inline-formula><math xmlns="http://www.w3.org/1998/Math/MathML" display="inline"><semantics><mrow><mi>m</mi><mo>×</mo><mi>...

Full description

Saved in:
Bibliographic Details
Main Author: Marcus R. Garvie
Format: Article
Language:English
Published: MDPI AG 2025-03-01
Series:Mathematics
Subjects:
Online Access:https://www.mdpi.com/2227-7390/13/6/1013
Tags: Add Tag
No Tags, Be the first to tag this record!
Description
Summary:Modular arithmetic is used to apply generalized <i>C</i>-coloured checkerboard patterns to <inline-formula><math xmlns="http://www.w3.org/1998/Math/MathML" display="inline"><semantics><mrow><mi>m</mi><mo>×</mo><mi>n</mi></mrow></semantics></math></inline-formula> 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 <inline-formula><math xmlns="http://www.w3.org/1998/Math/MathML" display="inline"><semantics><mrow><mi mathvariant="script">O</mi><mo>(</mo><mn>1</mn><mo>)</mo></mrow></semantics></math></inline-formula> operations, independent of <inline-formula><math xmlns="http://www.w3.org/1998/Math/MathML" display="inline"><semantics><mrow><mi>m</mi><mo>,</mo><mi>n</mi></mrow></semantics></math></inline-formula> and <i>C</i>. Numerical counts are validated using a brute-force procedure in MATLAB (Version 9.14, R2023a).
ISSN:2227-7390