题目
把 [0,87] × [0,87] 分成至少两个边与坐标轴平行的长方形,各顶点的坐标为整数,宽和高为正整数。每个单位格必须恰好被覆盖一次。任意两个长方形不能全等:比较宽和高时不区分方向,因此 w×h 和 h×w 算同一种形状。允许面积相同、形状不同的长方形。长方形的数量不固定。
设长方形的面积为 A_i = w_i h_i,缺陷为 D = max_i A_i − min_i A_i。得分就是 D,以单位格面积计,用精确整数运算计算;越小越好。这是 OEIS A276523 中固定 n = 87 的实例。
得分是整数。基线为 22,绝对 epsilon 为 1,因此低于基线的下一个整数得分是 21;任何满足 D ≤ 21 的有效证书都能改进基线。这并不表示缺陷为 21 的分割一定存在。
为什么重要
Gordon Hamilton 的 MathPickle 页面(2015)给出了 Mondrian 艺术问题。OEIS A276523 持续收录各个边长的构造与最优性注记。边长 87 的更小缺陷会改进该项由具体构造给出的上界。
用 M(87) 表示最小缺陷。Hannes Bassen,*Further Insight into the Mondrian Art Problem*(2016),表 II报告了通过计算排除的情形:3 ≤ n ≤ 419 时缺陷不能为 0,3 ≤ n ≤ 700 时不能为 1,4 ≤ n ≤ 897 时不能为 2,3 ≤ n ≤ 417 时不能为 3。每个范围都包含 87,因此 M(87) ≥ 4。结合 Muessig 的构造,得到 4 ≤ M(87) ≤ 22。这里的下界引自该计算结果,不声称它是已发表的最强下界。该构造标注的是 a(87)<=22,没有表示最优性的等号。
Few Shots 上的推进
从预设基线开始,每一行是一次经验证器复算的有效突破
- #022预设基线
- #1?等待挑战者
证书格式
- 提交名为
certificate.json 的普通文件,编码为 UTF-8 JSON,且顶层恰好只有一个键:{"rectangles":[[x,y,w,h],...]}。未知键和重复键都会被拒绝。 rectangles 是包含 2 到 1000 个数组的数组。每个内部数组恰好包含四个 JSON 整数:左下角坐标 (x,y)、宽 w 和高 h。原点 (0,0) 位于正方形左下角;x 向右增大,y 向上增大。一个长方形覆盖满足 x ≤ column < x+w 且 y ≤ row < y+h 的单位格。- 要求 w,h ≥ 1,x,y ≥ 0,x+w ≤ 87,y+h ≤ 87。布尔值、字符串、null、小数或指数形式的数、NaN 和无穷大都会被拒绝。整数记号最多包含 9 位十进制数字,不计开头的负号。
- 文件大小最多为 1048576 字节(1 MiB)。JSON 容器最多嵌套 8 层:根对象计为第 1 层,每嵌套一个对象或数组增加一层;标量值不增加层数。符合要求格式的证书有 3 层容器。
- 验证器检查总面积是否为 87² = 7569、无序边长对是否互不相同,以及是否无重叠地恰好覆盖整个正方形。它返回缺陷的十进制整数字符串,例如
"22"。即使得分没有改进纪录,只要分割有效也会被接受。
规范形式
哈希把长方形顺序的变化和正方形的八种对称变换视为同一种分割。以下比较都是对整数元组和列表进行数值字典序比较,不是比较它们的 JSON 文本。
对长方形 q = (x,y,w,h),定义逆时针旋转四分之一圈 R(q) = (87−y−h,x,h,w),以及反射 F(q) = (87−x−w,y,w,h)。对 k = 0,1,2,3,把每个长方形都作 R^k 变换,得到一种像;再对每个长方形先作 R^k、后作 F,得到另一种像。其中 R^0 是恒等变换。这样共得到八个候选。
在每个候选中,将四元组按 x、y、w、h 的顺序升序排列。按字典序比较得到的列表,在第一个不同的四元组处按数值比较,选取最小的列表 L。将对象严格序列化为 {"rectangles":L},其中每个四元组表示为 JSON 数组,每个数使用十进制整数值。不含任何空白、多余的键或末尾换行。等价的 Python 写法为 json.dumps({"rectangles": L}, sort_keys=True, separators=(",", ":"), ensure_ascii=True)。
canonical_hash 是这些 ASCII 字节的 SHA-256 摘要,以小写十六进制表示。输入中的空白、长方形的排列顺序、JSON 键的转义写法,以及八种整体对称变换都不会影响它。仅仅具有相同的一组长方形形状,并不会把不同的摆放方式视为同一种分割。
基线
Mia Muessig 的 OEIS 纪录注记(2025)给出 n = 87 时最好已知上界为 22。她的公开铺砌文件明确将该构造标注为 a(87)<=22。其中 13 个长方形的面积介于 572 和 594 之间(含两端),总面积为 7569;缺陷为 594−572 = 22。基线的长方形数量不是提交限制。
baseline/certificate.json 由该文件中的 87×87 字符网格重建而来:将每个标签替换为它对应的整数边界长方形,去掉标签,再将长方形排序。源文件的第一行对应 y=0,因此使用笛卡尔坐标的证书是所印网格从上到下排列方式的竖直翻转。源文件大小为 208711 字节,SHA-256 为 073c266cd84ab5480a696615b935bf95c23f7ec16a6a1c754dd65347518ec66b。所附基线的规范哈希为 9e35bae916e1f9877a693fae4d02bc2707ba790fd314b0886efc3ba857f9174b。
基线署名归属为 Mia Muessig / The Online Encyclopedia of Integer Sequences,A276523。它保留 CC BY-SA 4.0 许可,遵循 OEIS 许可协议,不采用新提交的 CC0 许可。来源链接、逐字保留的许可声明与改编细节见 baseline/LICENSE-OEIS.txt。验证器代码遵循仓库的 Apache-2.0 许可。
在仓库根目录复现:
python3 problems/p016-mondrian-87/verify/verify.py problems/p016-mondrian-87/baseline
Problem
Partition [0,87] × [0,87] into at least two axis-parallel rectangles whose corners have integer coordinates and whose widths and heights are positive integers. Every unit cell must be covered exactly once. No two rectangles may be congruent: widths and heights are compared without orientation, so w×h and h×w are the same shape. Rectangles with equal areas but different shapes are allowed. The number of rectangles is not fixed.
For rectangle areas A_i = w_i h_i, the defect is D = max_i A_i − min_i A_i. The score is D in unit cells of area, computed using exact integer arithmetic; lower is better. This is the fixed n = 87 instance of the problem in OEIS A276523.
The score is an integer. With baseline 22 and absolute epsilon 1, the next integer score below the baseline is 21; any valid certificate with D ≤ 21 improves the baseline. This does not assert that a dissection of defect 21 exists.
Why it matters
Gordon Hamilton's MathPickle page (2015) states the Mondrian art problem. OEIS A276523 maintains constructions and optimality annotations for individual side lengths. A smaller defect for side length 87 improves that entry's constructive upper bound.
Let M(87) denote the minimum defect. Hannes Bassen, *Further Insight into the Mondrian Art Problem* (2016), Table II reports computational exclusions of defect 0 for 3 ≤ n ≤ 419, defect 1 for 3 ≤ n ≤ 700, defect 2 for 4 ≤ n ≤ 897, and defect 3 for 3 ≤ n ≤ 417. Each range contains 87, hence M(87) ≥ 4. Together with Muessig's construction, this gives 4 ≤ M(87) ≤ 22. The lower bound is cited from that computation; it is not asserted to be the strongest published bound. The construction is marked a(87)<=22, without an optimality equality.
Progress on Few Shots
From the preset baseline, one row per valid breakthrough recomputed by the verifier
- #022Preset baseline
- #1?Awaiting a challenger
Certificate
- Submit a regular file named
certificate.json, encoded as UTF-8 JSON, with exactly one top-level key: {"rectangles":[[x,y,w,h],...]}. Unknown keys and duplicate keys are rejected. rectangles is an array containing between 2 and 1000 arrays. Each inner array contains exactly four JSON integers: the lower-left corner (x,y), width w and height h. The origin (0,0) is the square's lower-left corner; x increases rightward and y upward. A rectangle covers cells with x ≤ column < x+w and y ≤ row < y+h.- Require w,h ≥ 1, x,y ≥ 0, x+w ≤ 87, and y+h ≤ 87. Booleans, strings, null, decimal or exponent numbers, NaN and infinities are rejected. Integer tokens may contain at most 9 decimal digits, excluding a leading minus sign.
- The file is at most 1048576 bytes (1 MiB). JSON container nesting is at most 8 levels, counting the root object as level 1 and each nested object or array as one additional level; scalar values do not add a level. A certificate in the required schema has 3 container levels.
- The verifier checks total area 87² = 7569, distinct unordered side-length pairs, and exact coverage without overlap. It returns the defect as a decimal integer string, for example
"22". It accepts valid dissections even when their scores do not improve the record.
Canonical form
The hash identifies a dissection up to reordering its rectangles and the eight symmetries of the square. All comparisons below are numerical lexicographic comparisons of integer tuples and lists, not comparisons of their JSON text.
For a rectangle q = (x,y,w,h), define a counterclockwise quarter-turn R(q) = (87−y−h,x,h,w) and a reflection F(q) = (87−x−w,y,w,h). For k = 0,1,2,3, apply R^k to every rectangle to obtain one image, and apply F after R^k to every rectangle to obtain another image. Here R^0 is the identity. These are the eight candidates.
In each candidate, sort the quadruples ascending by x, then y, then w, then h. Compare the resulting lists lexicographically, comparing the first differing quadruple numerically, and choose the smallest list L. Serialize exactly the object {"rectangles":L} with each quadruple represented as a JSON array and each number as its base-10 integer value. Use no whitespace, no extra keys and no trailing newline. Equivalently, use Python json.dumps({"rectangles": L}, sort_keys=True, separators=(",", ":"), ensure_ascii=True).
canonical_hash is the lowercase hexadecimal SHA-256 digest of those ASCII bytes. Input whitespace, rectangle order, JSON key escaping and the eight global symmetries do not affect it. Merely sharing the same multiset of rectangle shapes does not identify different placements.
Baseline
Mia Muessig's OEIS record annotation (2025) gives a best-known upper bound of 22 for n = 87. Her public tiling file explicitly labels the construction a(87)<=22. Its 13 rectangles have areas between 572 and 594 inclusive and total area 7569; their defect is 594−572 = 22. The baseline's rectangle count is not a submission constraint.
baseline/certificate.json was reconstructed from that file's 87×87 character grid. Each label was replaced by its integer bounding rectangle, the labels were discarded, and the rectangles were sorted. The first source row becomes y=0, so the Cartesian certificate is a vertical reflection of the printed top-to-bottom grid. The source file is 208711 bytes, with SHA-256 073c266cd84ab5480a696615b935bf95c23f7ec16a6a1c754dd65347518ec66b. The canonical hash of the supplied baseline is 9e35bae916e1f9877a693fae4d02bc2707ba790fd314b0886efc3ba857f9174b.
The baseline is attributed to Mia Muessig / The Online Encyclopedia of Integer Sequences, A276523. It retains CC BY-SA 4.0 under the OEIS license agreement, rather than the CC0 license for new shots. The source links, verbatim license notice and adaptation details are in baseline/LICENSE-OEIS.txt. Verifier code follows the repository's Apache-2.0 license.
Reproduce from the repository root:
python3 problems/p016-mondrian-87/verify/verify.py problems/p016-mondrian-87/baseline