题目
有 n 个刻度的 Golomb 尺,是由 n 个互不相同的整数(刻度)组成的集合,其中两两刻度之差共 n(n − 1)/2 个,彼此都不相同。它的长度是最大刻度减去最小刻度。
对 n = 29(problem.toml 中的 [params] order),找出一把长度尽可能小的 29 刻度 Golomb 尺。差共有 29 · 28 / 2 = 406 个。得分为长度,是一个整数。
把所有刻度平移同一个整数,以及反射(x → c − x),都保持各个差(至多差一个符号)和长度不变。下面的规范形式把这些副本视为同一把尺。
得分是整数,因此低于基线的下一个可能取值是 622。
最小可能的长度 G(29) 未知。上界 623 即下面的基线。下界:
- 406,因为 406 个差是互不相同的正整数,且都不超过长度。
- 567:Carter、O'Bryant 和 Tao,arXiv:2610.36207(2026)在摘要中指出,含 k ≥ 1 个元素的 Sidon 集的直径至少为 k²(1/(1 + 0.945/√k) − 0.945/√k) − 1。Golomb 尺是 Sidon 集,它的直径就是它的长度;k = 29 时右边为 566.87…,所以长度至少为 567。该证明在此未经核验。
- 587,由 G(28) = 585 在此推出。distributed.net 报告其穷举搜索 OGR-28 于 2022 年完成,证明了最优的 28 刻度尺;Rokicki 和 Dogon(第 1 页)给出其长度为 585。设 x_0 < x_1 < … < x_28 为一把长度为 L 的 29 刻度 Golomb 尺的刻度,a = x_1 − x_0,b = x_28 − x_27。去掉 x_0 或 x_28,剩下一把长度为 L − a 或 L − b 的 28 刻度 Golomb 尺,所以 L − a ≥ 585 且 L − b ≥ 585。差 a 和 b 来自不同的两对刻度,所以 a ≠ b,从而 max(a, b) ≥ 2。因此 L ≥ 587。
29 刻度的最强已发表下界在此未经确认。这些界与计分无关。
为什么重要
两两之差互不相同的整数集合称为 Sidon 集;Erdős 和 Turán 在 On a problem of Sidon in additive number theory and on some related problems,J. London Math. Soc. 16 (1941) 212–215(Rokicki 和 Dogon 的参考文献 [6])中研究了这样的集合能有多大。刻度个数固定时,最短的 Golomb 尺是约束规划中的一道基准题(CSPLib prob006),CSPLib 列出的应用包括 X 射线晶体学和射电天文学中的传感器布置。
最短长度已证明到 28 个刻度。distributed.net 用穷举搜索解决了 24 到 28 的情形,OGR-24 于 2004 年完成,OGR-28 历时八年半于 2022 年完成(distributed.net 新闻;Rokicki 和 Dogon,§4,第 6 页)。刻度更多时,已知最短的尺来自有限几何构造:Singer,A theorem in finite projective geometry and some applications to number theory,Trans. Amer. Math. Soc. 43 (1938) 377–385(射影平面)和 Bose(仿射平面)。Rokicki 和 Dogon,*Larger Golomb Rulers*(为 G4G12 礼品交换而写;PDF 为 2016 年版)报告:James B. Shearer 约在 1986 年实现了这些构造,并列表给出了它们到 160 个刻度为止所能给出的最好的尺(第 2 页);这些构造给出了 16 个刻度以上所有规模的已知最好的尺(第 5 页)。他们还提出假设 A:对每个 n > 16,最优 Golomb 尺都能由仿射平面或射影平面构造生成(第 6 页)。
对 29 个刻度,这些构造给出的最短的尺长度为 623,来自 q = 29 的 Singer 构造(见基线)。长度为 622 或更短的 29 刻度 Golomb 尺,比这些来源中的所有 29 刻度尺都短。
Few Shots 上的推进
从预设基线开始,每一行是一次经验证器复算的有效突破
- #0623预设基线
- #1?等待挑战者
证书格式
- 文件名为
certificate.json,形如 {"marks": [0, 3, 28, …]},不含其他键。 marks 是恰好由 29 个 JSON 整数组成的列表,严格递增,每个都在 0 到 10^15 之间(含两端,[params] max_mark)。最小刻度不必为 0。布尔值、字符串、小数、指数形式(3.0、3e0)、NaN 和 Infinity 都会被拒绝;-0 视为整数 0。- 全部 406 个差 x_j − x_i(i < j)必须互不相同。
- 得分为 x_28 − x_0,即最大刻度减最小刻度,写成十进制整数字符串,例如
"623"。 - 文件为 UTF-8 编码的 JSON,不带字节顺序标记,大小不超过 65,536 字节,嵌套不超过 8 层,整数不超过 18 位 ASCII 数字,不含重复键(键在 JSON 反转义之后比较)。
- 规范形式。设 x_0 < … < x_28 为刻度,L = x_28 − x_0。
- 平移:A = [x_0 − x_0, x_1 − x_0, …, x_28 − x_0],于是 A 从 0 开始、到 L 结束。
- 反射:B = [L − A_28, L − A_27, …, L − A_0],同样递增,从 0 开始、到 L 结束。
- 按字典序保留 A 和 B 中较小的那个:从第一项起逐项作为整数比较。(这就是 Python 对整数列表的排序。)(对 3 个或更多刻度的 Golomb 尺,A = B 不可能出现,因为那会给出 x_1 − x_0 = x_28 − x_27。)
- 规范对象为
{"marks": C},C 为保留下来的列表。 canonical_hash 是该对象写成 JSON 后的小写十六进制 SHA-256:没有任何空白,整数用普通十进制,ASCII 字节,末尾没有换行;在 Python 中为 json.dumps(obj, sort_keys=True, separators=(",", ":"), ensure_ascii=True).encode("ascii")。
因此,两份证书的哈希相同,当且仅当其中一把尺是另一把的平移,或另一把的反射的平移。键中的空白和转义不进入哈希。与纪录打平,无论哪种情况都不算改进。
算例(4 个刻度,只用来演示计算):刻度 [10, 14, 17, 18] 给出 A = [0, 4, 7, 8],L = 8,B = [0, 1, 4, 8];B 较小,因此被哈希的字节为 {"marks":[0,1,4,8]},SHA-256 为 0b23813710787f97546f927f9dcc3f0c5e93035b0e9e1f9d3209da223d3e95ae。对基线,A 就是证书本身,B 以 [0, 7, 11, …] 开头,因此保留 A;被哈希的字节为 {"marks":[0,3,28,33,41,95,156,158,193,207,233,252,267,338,339,355,394,403,421,473,479,502,523,570,580,592,612,616,623]}(119 字节),canonical_hash 为 e4ad2bc601c9451ea6e8e0bd3af4abcb23bcc5a3e7d2a2c228a33ebc26f0ed9b。
基线
长度 623,刻度为
0, 3, 28, 33, 41, 95, 156, 158, 193, 207, 233, 252, 267, 338, 339, 355, 394, 403, 421, 473, 479, 502, 523, 570, 580, 592, 612, 616, 623.
这把尺来自 Singer 构造(1938),对应 q = 29 阶的射影平面,按 Rokicki 和 Dogon(§2–3)的描述构造。取 GF(29³) 的一个本原元 α。使 α^i 落在 GF(29³) 的一个固定的 2 维 GF(29) 子空间中的那些指数 i(模 q² + q + 1 = 871),构成 q + 1 = 30 个剩余,它们模 871 的 870 个差互不相同。把这个集合乘以模 871 的一个单位,把 30 个剩余按递增顺序排列,取其中 29 个循环相邻的剩余(去掉一个),再减去第一个并模 871。在所有单位和所有窗口中,得到的最短长度是 623,上面这把尺(至多差一次反射)就是长度为 623 的窗口之一。"order 29" 中的 29 是射影平面的阶;模尺有 30 个刻度,29 刻度的尺是从中截出来的。
Shearer 列出这些构造到 160 个刻度的表(IBM 研究网站,Rokicki 和 Dogon 的参考文献 [10])已无法访问,Rokicki 和 Dogon 的完整数据(cube20.org/golomb)也未核对,因此两张表中 29 个刻度的那一行在此都未经确认。本题的两份复审(出题帖 #49)各自从该构造独立重建出了这把尺;其中一份扫描了 q = 29、31 和 32 时 Singer 构造与 Bose 构造的所有单位和窗口,没有找到短于 623 的 29 刻度尺。
baseline/certificate.json 由上述构造计算得到,不含第三方数据文件。复现方法:
python3 problems/p014-golomb-ruler-29/verify/verify.py problems/p014-golomb-ruler-29/baseline
Problem
A Golomb ruler with n marks is a set of n distinct integers (the marks) such that the n(n − 1)/2 differences between pairs of marks are pairwise distinct. Its length is the largest mark minus the smallest mark.
For n = 29 ([params] order in problem.toml), find a Golomb ruler with 29 marks whose length is as small as possible. There are 29 · 28 / 2 = 406 differences. The score is the length, an integer.
Shifting every mark by the same integer and reflecting (x → c − x) keep the differences, up to sign, and the length. The canonical form below identifies these copies.
The score is an integer, so the next possible score below the baseline is 622.
The least possible length G(29) is not known. The upper bound 623 is the baseline below. Lower bounds:
- 406, since the 406 differences are distinct positive integers no larger than the length.
- 567: Carter, O'Bryant and Tao, arXiv:2610.36207 (2026) state in the abstract that a Sidon set with k ≥ 1 elements has diameter at least k²(1/(1 + 0.945/√k) − 0.945/√k) − 1. A Golomb ruler is a Sidon set and its diameter is its length; for k = 29 the right side is 566.87…, so the length is at least 567. The proof is not checked here.
- 587, derived here from G(28) = 585. distributed.net reports that its exhaustive search OGR-28 was completed in 2022 and proved the optimal 28-mark ruler, and Rokicki and Dogon (p. 1) give its length as 585. Let x_0 < x_1 < … < x_28 be the marks of a 29-mark Golomb ruler of length L, and a = x_1 − x_0, b = x_28 − x_27. Removing x_0, or x_28, leaves a 28-mark Golomb ruler of length L − a, or L − b, so L − a ≥ 585 and L − b ≥ 585. The differences a and b come from different pairs of marks, so a ≠ b and max(a, b) ≥ 2. Hence L ≥ 587.
The strongest published lower bound for 29 marks is not confirmed here. The bounds play no part in scoring.
Why it matters
A set of integers whose pairwise differences are distinct is a Sidon set; Erdős and Turán, On a problem of Sidon in additive number theory and on some related problems, J. London Math. Soc. 16 (1941) 212–215 (reference [6] of Rokicki and Dogon), studied how large such a set can be. For a fixed number of marks, the shortest Golomb ruler is a benchmark in constraint programming (CSPLib prob006), and CSPLib lists sensor placement for X-ray crystallography and radio astronomy among its applications.
Shortest lengths are proven up to 28 marks. distributed.net settled the cases 24 to 28 by exhaustive search, completing OGR-24 in 2004 and OGR-28 in 2022 after eight and a half years (distributed.net news; Rokicki and Dogon, §4, p. 6). For more marks, the shortest known rulers come from the finite-geometry constructions of Singer, A theorem in finite projective geometry and some applications to number theory, Trans. Amer. Math. Soc. 43 (1938) 377–385 (projective plane) and of Bose (affine plane). Rokicki and Dogon, *Larger Golomb Rulers* (written for the G4G12 gift exchange; the PDF is from 2016) report that James B. Shearer implemented these constructions around 1986 and tabulated the best rulers they give up to 160 marks (p. 2), that these constructions give the best known rulers for all sizes above 16 marks (p. 5), and state Hypothesis A: for every n > 16 the optimal Golomb ruler can be generated by an affine or projective plane construction (p. 6).
For 29 marks the shortest ruler these constructions give has length 623, from Singer's construction with q = 29 (see Baseline). A 29-mark Golomb ruler of length 622 or less is shorter than every 29-mark ruler in these sources.
Progress on Few Shots
From the preset baseline, one row per valid breakthrough recomputed by the verifier
- #0623Preset baseline
- #1?Awaiting a challenger
Certificate
- File name
certificate.json, shaped like {"marks": [0, 3, 28, …]}, with no other keys. marks is a list of exactly 29 JSON integers, in strictly increasing order, each between 0 and 10^15 inclusive ([params] max_mark). The smallest mark need not be 0. Booleans, strings, fractions, exponents (3.0, 3e0), NaN and Infinity are rejected; -0 is the integer 0.- All 406 differences x_j − x_i (i < j) must be distinct.
- The score is x_28 − x_0, the largest mark minus the smallest, as a decimal integer string, for example
"623". - The file is UTF-8 JSON without a byte order mark, at most 65,536 bytes, nested at most 8 levels, with integers of at most 18 ASCII digits and no duplicate keys (keys are compared after JSON unescaping).
- Canonical form. Let x_0 < … < x_28 be the marks and L = x_28 − x_0.
- Shift: A = [x_0 − x_0, x_1 − x_0, …, x_28 − x_0], so A starts at 0 and ends at L.
- Reflect: B = [L − A_28, L − A_27, …, L − A_0], also increasing, starting at 0 and ending at L.
- Keep the smaller of A and B in lexicographic order: compare entry by entry from the first, as integers. (This is Python's ordering of lists of integers.) (A = B is impossible for a Golomb ruler with 3 or more marks, since it would give x_1 − x_0 = x_28 − x_27.)
- The canonical object is
{"marks": C} with C the kept list. canonical_hash is the lowercase hex SHA-256 of that object written as JSON with no whitespace at all, integers in plain decimal, ASCII bytes, no trailing newline; in Python, json.dumps(obj, sort_keys=True, separators=(",", ":"), ensure_ascii=True).encode("ascii").
So two certificates have the same hash exactly when one ruler is a shift, or a shift of the reflection, of the other. Whitespace and escapes in the key do not enter the hash. A tie with the record is not an improvement either way.
Worked example (4 marks, only to show the computation): the marks [10, 14, 17, 18] give A = [0, 4, 7, 8], L = 8 and B = [0, 1, 4, 8]; B is smaller, so the hashed bytes are {"marks":[0,1,4,8]}, with SHA-256 0b23813710787f97546f927f9dcc3f0c5e93035b0e9e1f9d3209da223d3e95ae. For the baseline, A is the certificate itself and B begins [0, 7, 11, …], so A is kept; the hashed bytes are {"marks":[0,3,28,33,41,95,156,158,193,207,233,252,267,338,339,355,394,403,421,473,479,502,523,570,580,592,612,616,623]} (119 bytes), and canonical_hash is e4ad2bc601c9451ea6e8e0bd3af4abcb23bcc5a3e7d2a2c228a33ebc26f0ed9b.
Baseline
Length 623, with the marks
0, 3, 28, 33, 41, 95, 156, 158, 193, 207, 233, 252, 267, 338, 339, 355, 394, 403, 421, 473, 479, 502, 523, 570, 580, 592, 612, 616, 623.
The ruler comes from Singer's construction (1938) for the projective plane of order q = 29, as described by Rokicki and Dogon (§2–3). Take a primitive element α of GF(29³). The exponents i modulo q² + q + 1 = 871 for which α^i lies in a fixed 2-dimensional GF(29)-subspace of GF(29³) form a set of q + 1 = 30 residues whose 870 differences modulo 871 are all distinct. Multiply this set by a unit modulo 871, list the 30 residues in increasing order, take 29 cyclically consecutive residues (drop one) and subtract the first modulo 871. Over all units and all windows the shortest result has length 623, and the ruler above, up to reflection, is one of the windows of that length. The 29 in "order 29" is the order of the projective plane; the modular ruler has 30 marks and the 29-mark ruler is cut from it.
Shearer's table of these constructions up to 160 marks (IBM research site, cited by Rokicki and Dogon as reference [10]) is offline, and the full data of Rokicki and Dogon (cube20.org/golomb) was not checked, so the 29-mark row of either table is not confirmed here. The two reviews of this problem (proposal issue #49) each rebuilt this ruler independently from the construction; one of them scanned all units and windows of the Singer and Bose constructions for q = 29, 31 and 32 and found no 29-mark ruler shorter than 623.
baseline/certificate.json was computed from the construction above; it contains no third-party data file. To reproduce:
python3 problems/p014-golomb-ruler-29/verify/verify.py problems/p014-golomb-ruler-29/baseline