可视化 196 号 Lychrel 数链中的不对称性 (5 万步,2 万位)

1作者: jivaprime7 个月前
我一直在试验经典的 196 Lychrel 问题,但与其试图打破迭代记录,我更想看看 196 序列随时间的演变<i>结构</i>。<p>简而言之:从十进制的 196 开始,我们反复进行反转相加。尽管进行了大量的计算搜索,但仍未发现回文数,因此 196 被视为一个 Lychrel <i>候选数</i>,但也没有任何确凿的证明。<p>我没有仅仅问“它是否会变成回文数?”,而是问:<p>&gt; 196 序列的*数字不对称性*在迭代过程中会是什么样子?<p>---<p>### SDI:一个简单的不对称性度量<p>我定义了一个简单的度量,*SDI(对称缺陷指数)*:<p>* 将 `n` 写成十进制,长度为 `L`,令 `pairs = L &#x2F;&#x2F; 2`。<p>* 将左边的 `pairs` 位数字与右边的 `pairs` 位数字反转后进行比较,因此每对数字“面对”其镜像。<p>* 对于每对 `(dL, dR)`:<p><pre><code> ```text pair_score = abs((dL % 2) - (dR % 2)) + abs((dL % 5) - (dR % 5)) ``` </code></pre> * 对所有对求和得到 `SDI`,然后进行归一化:<p><pre><code> ```text normalized_SDI = SDI &#x2F; pairs ``` </code></pre> 启发式:较低的值表示“更对称/结构化”,较高的值表示“更不对称/更接近随机”。 对于随机十进制数字,在我的测试中,归一化 SDI 聚集在 ~2.1 附近。我还会将 ~1.6 标记为“僵尸线”:远低于该值看起来非常冻结/结构化。<p>---<p>### 实验<p>* 开始:196 * 操作:十进制反转相加 * 步数:50,000 * 每 100 步采样一次 SDI * 实现:Python 大整数 + 基于字符串的 SDI<p>在 5 万步时,196 链达到约 20,000 位十进制数字 (~10^20000)。我绘制了归一化 SDI 与步数的图,以及一条线性趋势线和参考线,分别位于 2.1(随机)和 1.6(僵尸线)。<p>我还对 89 运行了相同的 SDI(它<i>确实</i>达到了回文数)进行比较。<p>---<p>### 结果<p>*对于 196(0–5 万步):*<p>* 归一化 SDI 主要介于 ~1.1 和 2.2 之间。 * 它*没有*向 0 漂移(没有“恢复”成对称性的迹象)。 * 趋势线有一个微小的正斜率(几乎是平的)。 * 云点保持在 ~2.1“随机”线以下,但大部分在 ~1.6“僵尸线”以上。<p>因此,196 看起来并没有收敛到非常对称的状态,而且它看起来也不完全是随机的。它似乎被困在一个中等水平的“僵尸带”不对称性中。<p>*对于 89:*<p>* SDI 从 2–3 左右开始,然后向下漂移。 * 当 89 最终达到回文数时,SDI 在该步骤骤降至 0。 * 这与直觉相符:一个“恢复”序列,最终达到完美的对称性。<p>SDI 清晰地将 89 的行为(恢复成回文数)与 196 的行为(停留在嘈杂的中等水平带)区分开来。<p>---<p>### 代码和图表<p>代码和图表在这里(包括 SDI 实现和 196 与 89 的图表):<p>* GitHub:[https:&#x2F;&#x2F;github.com&#x2F;jivaprime&#x2F;192](https:&#x2F;&#x2F;github.com&#x2F;jivaprime&#x2F;192)<p>---<p>### 寻求反馈<p>我对以下内容感兴趣:<p>* 类似工作:您以前是否见过将数字对称性/不对称性度量应用于 Lychrel 候选数? * 更好的度量:您推荐任何更标准的“对称缺陷”或数字熵的概念吗? * 扩展:关于 C/Rust 实现的想法,该实现偶尔会远超于此地采样 SDI(例如,在与经典的 196 回文数搜索相当的深度)?<p>如果大家有想法,很乐意调整度量、运行其他起始值/基数或收集更多数据。
查看原文
I’ve been experimenting with the classic 196 Lychrel problem, but instead of trying to push the iteration record, I wanted to look at the <i>structure</i> of the 196 sequence over time.<p>Very briefly: starting from 196 in base 10, we repeatedly do reverse-and-add. No palindrome is known, despite huge computational searches, so 196 is treated as a Lychrel <i>candidate</i>, but there is no proof either way.<p>Rather than just asking “does it ever hit a palindrome?”, I asked:<p>&gt; What does the *digit asymmetry* of the 196 sequence look like as we iterate?<p>---<p>### SDI: a simple asymmetry metric<p>I defined a toy metric, *SDI (Symmetry Defect Index)*:<p>* Write `n` in decimal, length `L`, let `pairs = L &#x2F;&#x2F; 2`.<p>* Compare the left `pairs` digits with the right `pairs` digits reversed, so each pair of digits “faces” its mirror.<p>* For each pair `(dL, dR)`:<p><pre><code> ```text pair_score = abs((dL % 2) - (dR % 2)) + abs((dL % 5) - (dR % 5)) ``` </code></pre> * Sum over all pairs to get `SDI`, then normalize:<p><pre><code> ```text normalized_SDI = SDI &#x2F; pairs ``` </code></pre> Heuristic: lower means “more symmetric &#x2F; structured”, higher means “more asymmetric &#x2F; closer to random”. For random decimal digits, normalized SDI clusters around ~2.1 in my tests. I also mark ~1.6 as a “zombie line”: well below that looks very frozen&#x2F;structured.<p>---<p>### Experiment<p>* Start: 196 * Operation: base-10 reverse-and-add * Steps: 50,000 * SDI sampled every 100 steps * Implementation: Python big ints + string-based SDI<p>By 50k steps, the 196 chain reaches about 20,000 decimal digits (~10^20000). I plotted normalized SDI vs step, plus a linear trend line and reference lines at 2.1 (random-ish) and 1.6 (zombie line).<p>I also ran the same SDI on 89 (which <i>does</i> reach a palindrome) for comparison.<p>---<p>### What it looks like<p>*For 196 (0–50k steps):*<p>* Normalized SDI lives mostly between ~1.1 and 2.2. * It does *not* drift toward 0 (no sign of “healing” into symmetry). * The trend line has a tiny positive slope (almost flat). * The cloud stays below the ~2.1 “random” line but mostly above the ~1.6 “zombie line”.<p>So 196 doesn’t look like it’s converging to a very symmetric state, and it doesn’t look fully random either. It seems stuck in a mid-level “zombie band” of asymmetry.<p>*For 89:*<p>* SDI starts around 2–3, then drifts downward. * When 89 finally reaches a palindrome, SDI collapses sharply to 0 at that step. * This matches the intuition: a “healing” sequence that ends in perfect symmetry.<p>SDI cleanly separates the behaviour of 89 (heals to a palindrome) from 196 (stays in a noisy mid-level band).<p>---<p>### Code and plots<p>Code and plots are here (including the SDI implementation and 196 vs 89 graphs):<p>* GitHub: [https:&#x2F;&#x2F;github.com&#x2F;jivaprime&#x2F;192](https:&#x2F;&#x2F;github.com&#x2F;jivaprime&#x2F;192)<p>---<p>### Looking for feedback<p>I’m curious about:<p>* Similar work: have you seen digit-symmetry &#x2F; asymmetry metrics applied to Lychrel candidates before? * Better metrics: any more standard notions of “symmetry defect” or digit entropy you’d recommend? * Scaling: ideas for a C&#x2F;Rust implementation that occasionally samples SDI far beyond this (e.g., at depths comparable to the classic 196 palindrome quests)?<p>Happy to tweak the metric, run other starting values &#x2F; bases, or collect more data if people have ideas.