<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: MORC</title>
    <description>The latest articles on DEV Community by MORC (@morc_b13).</description>
    <link>https://dev.to/morc_b13</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F3789193%2F7b7fb91d-72b1-4941-9e48-fcea110ffb1f.png</url>
      <title>DEV Community: MORC</title>
      <link>https://dev.to/morc_b13</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/morc_b13"/>
    <language>en</language>
    <item>
      <title>Ramanujan's 1103 and 26390: An Addition-Only Sequence, and Two Integers That Remember π 58</title>
      <dc:creator>MORC</dc:creator>
      <pubDate>Thu, 19 Nov 2026 00:58:53 +0000</pubDate>
      <link>https://dev.to/morc_b13/ramanujans-1103-and-26390-an-addition-only-sequence-and-two-integers-that-remember-p58-24b6</link>
      <guid>https://dev.to/morc_b13/ramanujans-1103-and-26390-an-addition-only-sequence-and-two-integers-that-remember-p58-24b6</guid>
      <description>&lt;h2&gt;
  
  
  The formula
&lt;/h2&gt;

&lt;p&gt;In 1914, Srinivasa Ramanujan published this series for 1/π:&lt;/p&gt;

&lt;p&gt;

&lt;/p&gt;
&lt;div class="katex-element"&gt;
  &lt;span class="katex-display"&gt;&lt;span class="katex"&gt;&lt;span class="katex-mathml"&gt;&lt;/span&gt;&lt;span class="katex-html"&gt;&lt;span class="base"&gt;&lt;span class="strut"&gt;&lt;/span&gt;&lt;span class="mord"&gt;&lt;span class="mopen nulldelimiter"&gt;&lt;/span&gt;&lt;span class="mfrac"&gt;&lt;span class="vlist-t vlist-t2"&gt;&lt;span class="vlist-r"&gt;&lt;span class="vlist"&gt;&lt;span&gt;&lt;span class="pstrut"&gt;&lt;/span&gt;&lt;span class="mord"&gt;&lt;span class="mord mathnormal"&gt;π&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span&gt;&lt;span class="pstrut"&gt;&lt;/span&gt;&lt;span class="frac-line"&gt;&lt;/span&gt;&lt;/span&gt;&lt;span&gt;&lt;span class="pstrut"&gt;&lt;/span&gt;&lt;span class="mord"&gt;&lt;span class="mord"&gt;1&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="vlist-s"&gt;​&lt;/span&gt;&lt;/span&gt;&lt;span class="vlist-r"&gt;&lt;span class="vlist"&gt;&lt;span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="mclose nulldelimiter"&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="mspace"&gt;&lt;/span&gt;&lt;span class="mrel"&gt;=&lt;/span&gt;&lt;span class="mspace"&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="base"&gt;&lt;span class="strut"&gt;&lt;/span&gt;&lt;span class="mord"&gt;&lt;span class="mopen nulldelimiter"&gt;&lt;/span&gt;&lt;span class="mfrac"&gt;&lt;span class="vlist-t vlist-t2"&gt;&lt;span class="vlist-r"&gt;&lt;span class="vlist"&gt;&lt;span&gt;&lt;span class="pstrut"&gt;&lt;/span&gt;&lt;span class="mord"&gt;&lt;span class="mord"&gt;9801&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span&gt;&lt;span class="pstrut"&gt;&lt;/span&gt;&lt;span class="frac-line"&gt;&lt;/span&gt;&lt;/span&gt;&lt;span&gt;&lt;span class="pstrut"&gt;&lt;/span&gt;&lt;span class="mord"&gt;&lt;span class="mord"&gt;2&lt;/span&gt;&lt;span class="mord sqrt"&gt;&lt;span class="vlist-t vlist-t2"&gt;&lt;span class="vlist-r"&gt;&lt;span class="vlist"&gt;&lt;span class="svg-align"&gt;&lt;span class="pstrut"&gt;&lt;/span&gt;&lt;span class="mord"&gt;&lt;span class="mord"&gt;2&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span&gt;&lt;span class="pstrut"&gt;&lt;/span&gt;&lt;span class="hide-tail"&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="vlist-s"&gt;​&lt;/span&gt;&lt;/span&gt;&lt;span class="vlist-r"&gt;&lt;span class="vlist"&gt;&lt;span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="vlist-s"&gt;​&lt;/span&gt;&lt;/span&gt;&lt;span class="vlist-r"&gt;&lt;span class="vlist"&gt;&lt;span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="mclose nulldelimiter"&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="mspace"&gt;&lt;/span&gt;&lt;span class="mop op-limits"&gt;&lt;span class="vlist-t vlist-t2"&gt;&lt;span class="vlist-r"&gt;&lt;span class="vlist"&gt;&lt;span&gt;&lt;span class="pstrut"&gt;&lt;/span&gt;&lt;span class="sizing reset-size6 size3 mtight"&gt;&lt;span class="mord mtight"&gt;&lt;span class="mord mathnormal mtight"&gt;k&lt;/span&gt;&lt;span class="mrel mtight"&gt;=&lt;/span&gt;&lt;span class="mord mtight"&gt;0&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span&gt;&lt;span class="pstrut"&gt;&lt;/span&gt;&lt;span&gt;&lt;span class="mop op-symbol large-op"&gt;∑&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span&gt;&lt;span class="pstrut"&gt;&lt;/span&gt;&lt;span class="sizing reset-size6 size3 mtight"&gt;&lt;span class="mord mtight"&gt;&lt;span class="mord mtight"&gt;∞&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="vlist-s"&gt;​&lt;/span&gt;&lt;/span&gt;&lt;span class="vlist-r"&gt;&lt;span class="vlist"&gt;&lt;span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="mspace"&gt;&lt;/span&gt;&lt;span class="mord"&gt;&lt;span class="mopen nulldelimiter"&gt;&lt;/span&gt;&lt;span class="mfrac"&gt;&lt;span class="vlist-t vlist-t2"&gt;&lt;span class="vlist-r"&gt;&lt;span class="vlist"&gt;&lt;span&gt;&lt;span class="pstrut"&gt;&lt;/span&gt;&lt;span class="mord"&gt;&lt;span class="mopen"&gt;(&lt;/span&gt;&lt;span class="mord mathnormal"&gt;k&lt;/span&gt;&lt;span class="mclose"&gt;!&lt;/span&gt;&lt;span class="mclose"&gt;&lt;span class="mclose"&gt;)&lt;/span&gt;&lt;span class="msupsub"&gt;&lt;span class="vlist-t"&gt;&lt;span class="vlist-r"&gt;&lt;span class="vlist"&gt;&lt;span&gt;&lt;span class="pstrut"&gt;&lt;/span&gt;&lt;span class="sizing reset-size6 size3 mtight"&gt;&lt;span class="mord mtight"&gt;4&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="mspace"&gt;&lt;/span&gt;&lt;span class="mord"&gt;39&lt;/span&gt;&lt;span class="mord"&gt;&lt;span class="mord"&gt;6&lt;/span&gt;&lt;span class="msupsub"&gt;&lt;span class="vlist-t"&gt;&lt;span class="vlist-r"&gt;&lt;span class="vlist"&gt;&lt;span&gt;&lt;span class="pstrut"&gt;&lt;/span&gt;&lt;span class="sizing reset-size6 size3 mtight"&gt;&lt;span class="mord mtight"&gt;&lt;span class="mord mtight"&gt;4&lt;/span&gt;&lt;span class="mord mathnormal mtight"&gt;k&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span&gt;&lt;span class="pstrut"&gt;&lt;/span&gt;&lt;span class="frac-line"&gt;&lt;/span&gt;&lt;/span&gt;&lt;span&gt;&lt;span class="pstrut"&gt;&lt;/span&gt;&lt;span class="mord"&gt;&lt;span class="mopen"&gt;(&lt;/span&gt;&lt;span class="mord"&gt;4&lt;/span&gt;&lt;span class="mord mathnormal"&gt;k&lt;/span&gt;&lt;span class="mclose"&gt;)!&lt;/span&gt;&lt;span class="mspace"&gt;&lt;/span&gt;&lt;span class="mopen"&gt;(&lt;/span&gt;&lt;span class="mord"&gt;1103&lt;/span&gt;&lt;span class="mspace"&gt;&lt;/span&gt;&lt;span class="mbin"&gt;+&lt;/span&gt;&lt;span class="mspace"&gt;&lt;/span&gt;&lt;span class="mord"&gt;26390&lt;/span&gt;&lt;span class="mord mathnormal"&gt;k&lt;/span&gt;&lt;span class="mclose"&gt;)&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="vlist-s"&gt;​&lt;/span&gt;&lt;/span&gt;&lt;span class="vlist-r"&gt;&lt;span class="vlist"&gt;&lt;span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="mclose nulldelimiter"&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;/div&gt;


&lt;p&gt;The first term alone (k = 0) already gives&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;2√2 · 1103 / 9801 = 0.31830987844…&lt;/li&gt;
&lt;li&gt;1/π = 0.31830988618…&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;eight correct digits from one term. Each further term adds about eight more.&lt;/p&gt;

&lt;p&gt;So where do &lt;strong&gt;1103&lt;/strong&gt; and &lt;strong&gt;26390&lt;/strong&gt; come from? I looked at them with one rule: use integers and addition only. This post collects two of my notes (originally written in Japanese on Zenn) into one story.&lt;/p&gt;

&lt;h2&gt;
  
  
  Part 1 — 1103 and 26390 are neighbours in an addition-only sequence
&lt;/h2&gt;

&lt;h3&gt;
  
  
  26390 = 24 × 1103 − 82
&lt;/h3&gt;

&lt;p&gt;Multiply 1103 by 24 and you overshoot 26390 by exactly 82. That suggests the recurrence&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;a(n+1) = 24 · a(n) − a(n−1)&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Run it backwards and forwards and you get one sequence:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;…, 865, 82, &lt;strong&gt;1103&lt;/strong&gt;, &lt;strong&gt;26390&lt;/strong&gt;, 632257, 15147778, 362914415, …&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;1103 and 26390 are adjacent terms. The recurrence only needs addition: 24·a is a doubling ladder (a, 2a, 4a, 8a, 16a; then 16a + 8a), and subtraction is adding the negative.&lt;/p&gt;

&lt;p&gt;I also checked one integer that stays fixed along the whole sequence:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;a(n+1)² − 24 · a(n) · a(n+1) + a(n)² = −947371&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;It holds for every adjacent pair I computed (14 terms, from 865 up to a 19-digit number). This is what keeps the sequence on one track.&lt;/p&gt;

&lt;h3&gt;
  
  
  24 = 11 + 13, a pair of twin primes
&lt;/h3&gt;

&lt;p&gt;The coefficient 24 is the sum of the twin primes 11 and 13. For twin primes there is a tidy identity:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;(p + q)² − 4 = 4pq  ⇔  |p − q| = 2&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;because (p + q)² − 4 − 4pq = (p − q)² − 4.&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;(p, q)&lt;/th&gt;
&lt;th&gt;(p+q)² − 4&lt;/th&gt;
&lt;th&gt;4pq&lt;/th&gt;
&lt;th&gt;&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;(3, 5)&lt;/td&gt;
&lt;td&gt;60&lt;/td&gt;
&lt;td&gt;60&lt;/td&gt;
&lt;td&gt;√15&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;(5, 7)&lt;/td&gt;
&lt;td&gt;140&lt;/td&gt;
&lt;td&gt;140&lt;/td&gt;
&lt;td&gt;√35&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;(11, 13)&lt;/td&gt;
&lt;td&gt;572&lt;/td&gt;
&lt;td&gt;572&lt;/td&gt;
&lt;td&gt;√143&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;(17, 19)&lt;/td&gt;
&lt;td&gt;1292&lt;/td&gt;
&lt;td&gt;1292&lt;/td&gt;
&lt;td&gt;√323&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;(29, 31)&lt;/td&gt;
&lt;td&gt;3596&lt;/td&gt;
&lt;td&gt;3596&lt;/td&gt;
&lt;td&gt;√899&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;Pairs that are not twins miss: (11, 17) gives 780 vs 748, and (7, 13) gives 396 vs 364.&lt;/p&gt;

&lt;p&gt;For our sequence this means the characteristic equation x² − 24x + 1 = 0 has the roots 12 ± √143. The ratio of neighbouring terms heads toward 12 + √143 = 23.9582607431…&lt;/p&gt;

&lt;h3&gt;
  
  
  Converging without reaching
&lt;/h3&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F786uweu1kxbibvdw355b.gif" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F786uweu1kxbibvdw355b.gif" alt="Residuals of three sequences on a log scale" width="800" height="448"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The animation plots, step by step, how far three sequences still are from their limits (log scale). Every value was computed with integers scaled by 10²⁶⁰ (π itself from Machin's formula, added and subtracted term by term):&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Sequence&lt;/th&gt;
&lt;th&gt;Limit&lt;/th&gt;
&lt;th&gt;Digits gained per step&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Fibonacci ratios F(n+1)/F(n)&lt;/td&gt;
&lt;td&gt;φ&lt;/td&gt;
&lt;td&gt;0.42&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;24-recurrence ratios a(n+1)/a(n)&lt;/td&gt;
&lt;td&gt;12 + √143&lt;/td&gt;
&lt;td&gt;2.8&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Ramanujan partial sums&lt;/td&gt;
&lt;td&gt;1/π&lt;/td&gt;
&lt;td&gt;8.0&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;All three are straight lines. Only the slope differs. None of them reaches its limit in finitely many steps; what is left at each step is the &lt;strong&gt;residual&lt;/strong&gt; (in my framework I call it &lt;em&gt;zansa&lt;/em&gt;). The residual is not noise. It is the signature of how the sequence is built.&lt;/p&gt;

&lt;h2&gt;
  
  
  Part 2 — two integers remember π√N
&lt;/h2&gt;

&lt;h3&gt;
  
  
  Divide b by a, then by π, then square
&lt;/h3&gt;

&lt;p&gt;Take the two integers of the formula, a = 1103 and b = 26390:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;b / a = 23.92565729…&lt;/li&gt;
&lt;li&gt;π√58 = 23.92565684…&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;They agree to seven digits. Square b ÷ a ÷ π and you land next to 58:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;(26390 ÷ 1103 ÷ π)² = 58.0000022…&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;58 is the &lt;em&gt;level&lt;/em&gt; of this formula (its CM point is τ = i√58 / 2). The same trick works for other Ramanujan-type series:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Ftbfl12gmhcyewmmpopca.gif" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Ftbfl12gmhcyewmmpopca.gif" alt="Recovering N from two integers" width="800" height="448"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Formula&lt;/th&gt;
&lt;th&gt;a&lt;/th&gt;
&lt;th&gt;b&lt;/th&gt;
&lt;th&gt;(b ÷ a ÷ π)²&lt;/th&gt;
&lt;th&gt;N&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Ramanujan (44)&lt;/td&gt;
&lt;td&gt;1103&lt;/td&gt;
&lt;td&gt;26390&lt;/td&gt;
&lt;td&gt;58.0000022…&lt;/td&gt;
&lt;td&gt;58&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Ramanujan (39), alternating&lt;/td&gt;
&lt;td&gt;1123&lt;/td&gt;
&lt;td&gt;21460&lt;/td&gt;
&lt;td&gt;36.9998682…&lt;/td&gt;
&lt;td&gt;37&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Ramanujan (43)&lt;/td&gt;
&lt;td&gt;19&lt;/td&gt;
&lt;td&gt;280&lt;/td&gt;
&lt;td&gt;22.0043789…&lt;/td&gt;
&lt;td&gt;22&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Chudnovsky&lt;/td&gt;
&lt;td&gt;13591409&lt;/td&gt;
&lt;td&gt;545140134&lt;/td&gt;
&lt;td&gt;162.99999999999494…&lt;/td&gt;
&lt;td&gt;163&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;(Values computed again for this post with integers scaled by 10²⁶⁰.)&lt;/p&gt;

&lt;h3&gt;
  
  
  Is that just luck? A control
&lt;/h3&gt;

&lt;p&gt;I drew 20,000 random integer pairs (a up to 10⁵, b up to 10⁶, skipping pairs whose nearest integer is 0) and measured how far (b ÷ a ÷ π)² falls from the nearest integer:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;median distance: 0.25, exactly what you expect from chance&lt;/li&gt;
&lt;li&gt;within 10⁻³: 0.225 % of the pairs&lt;/li&gt;
&lt;li&gt;within 10⁻⁵: none&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The real formulas sit at 10⁻²·⁴, 10⁻³·⁹, 10⁻⁵·⁷ and 10⁻¹¹·³, far outside the grey cloud in the animation.&lt;/p&gt;

&lt;h3&gt;
  
  
  The two parts meet at 24 and 82
&lt;/h3&gt;

&lt;p&gt;Round π√58 to the nearest integer: m = 24. Now compute the "residue" of the formula's pair:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;r = m · a − b = 24 × 1103 − 26390 = &lt;strong&gt;82&lt;/strong&gt;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;These are the same 24 and 82 from Part 1. Read from the addition side, 26390 is "24 times 1103, minus 82". Read from the π side, 24 is the integer nearest π√58 and 82 is what is left over.&lt;/p&gt;

&lt;h3&gt;
  
  
  Where does b/a ≈ π√N come from?
&lt;/h3&gt;

&lt;p&gt;This part is known mathematics, not mine. In the theory of Ramanujan-type series (Chudnovsky; Chan and Yang; the surveys by Zudilin and by Baruah, Berndt and Chan), the factor 1/π comes from the non-holomorphic part of the Eisenstein series E₂, and at the CM point the ratio b/a is fixed by modular data. In my Japanese note I wrote this as one identity valid for both the level-1 (j) and level-2 families, checked it at 50-digit precision on 22 known formulas, and expanded b/a in powers of q with no free parameters. That note has the details and its own negative controls.&lt;/p&gt;

&lt;h2&gt;
  
  
  What is known, and what is mine
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Known:&lt;/strong&gt; Ramanujan's 1914 formulas, the Chudnovsky formula, the modular explanation of 1/π, and Y. Zhao's modular derivation of 1103 and 26390 (2020).&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;What I add:&lt;/strong&gt; reading 1103 and 26390 as adjacent terms of the addition-only sequence a(n+1) = 24a(n) − a(n−1), the twin-prime view of 24 and √143, the residual comparison above, and recovering N from two integers with a random control.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Not claimed:&lt;/strong&gt; that the twin-prime reading &lt;em&gt;explains&lt;/em&gt; Ramanujan's formula. It is a different viewpoint on the same integers, computed with addition alone.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Read more (Japanese)
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;The additive sequence (expanded edition): &lt;a href="https://zenn.dev/morc_b13/articles/351794ef91db16" rel="noopener noreferrer"&gt;https://zenn.dev/morc_b13/articles/351794ef91db16&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;Coefficient ratio and π√N: &lt;a href="https://zenn.dev/morc_b13/articles/16abf5780e2c62" rel="noopener noreferrer"&gt;https://zenn.dev/morc_b13/articles/16abf5780e2c62&lt;/a&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  References
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;S. Ramanujan, "Modular equations and approximations to π", &lt;em&gt;Quart. J. Math.&lt;/em&gt; 45 (1914), 350–372.&lt;/li&gt;
&lt;li&gt;D. V. Chudnovsky and G. V. Chudnovsky, "Approximations and complex multiplication according to Ramanujan", in &lt;em&gt;Ramanujan Revisited&lt;/em&gt;, Academic Press, 1988, 375–472.&lt;/li&gt;
&lt;li&gt;W. Zudilin, "Ramanujan-type formulae for 1/π: A second wind?", arXiv:0712.1332.&lt;/li&gt;
&lt;li&gt;N. D. Baruah, B. C. Berndt, H. H. Chan, "Ramanujan's Series for 1/π: A Survey", &lt;em&gt;Amer. Math. Monthly&lt;/em&gt; 116 (2009), 567–587.&lt;/li&gt;
&lt;li&gt;Y. Zhao, "A modular proof of two of Ramanujan's formulae for 1/π", &lt;em&gt;J. Aust. Math. Soc.&lt;/em&gt; 109 (2020), 131–144.&lt;/li&gt;
&lt;li&gt;J. M. Borwein and P. B. Borwein, &lt;em&gt;Pi and the AGM&lt;/em&gt;, Wiley, 1987.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Summary
&lt;/h2&gt;

&lt;p&gt;1103 and 26390 are two neighbouring terms of a sequence that needs nothing but addition: a(n+1) = 24a(n) − a(n−1), with 24 = 11 + 13. Its ratio creeps toward 12 + √143 without ever arriving, just as Fibonacci ratios creep toward φ and Ramanujan's partial sums creep toward 1/π. Only the speed differs.&lt;/p&gt;

&lt;p&gt;The same two integers also remember the level of the formula: (26390 ÷ 1103 ÷ π)² = 58.0000022…, and random pairs never come that close. Both readings meet at the same numbers. 24 is the integer nearest π√58, and 82 is what is left over.&lt;/p&gt;

</description>
      <category>math</category>
      <category>algorithms</category>
      <category>computerscience</category>
      <category>programming</category>
    </item>
    <item>
      <title>A Scientific Calculator Where 0.1 + 0.2 Is Exactly 0.3 — Built From Addition Alone</title>
      <dc:creator>MORC</dc:creator>
      <pubDate>Thu, 19 Nov 2026 00:13:19 +0000</pubDate>
      <link>https://dev.to/morc_b13/a-scientific-calculator-where-01-02-is-exactly-03-built-from-addition-alone-4e89</link>
      <guid>https://dev.to/morc_b13/a-scientific-calculator-where-01-02-is-exactly-03-built-from-addition-alone-4e89</guid>
      <description>&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F7ul91agjt83v8922059w.gif" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F7ul91agjt83v8922059w.gif" alt=" " width="800" height="336"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Is 0.1 + 0.2 equal to 0.3?
&lt;/h2&gt;

&lt;p&gt;In JavaScript or Python, &lt;code&gt;0.1 + 0.2&lt;/code&gt; gives &lt;code&gt;0.30000000000000004&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;I ran a few more expressions in Node.js and Python:&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Expression&lt;/th&gt;
&lt;th&gt;JavaScript / Python&lt;/th&gt;
&lt;th&gt;morc calculator&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;0.1 + 0.2&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;0.30000000000000004&lt;/td&gt;
&lt;td&gt;= 0.3&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;0.1 * 3&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;0.30000000000000004&lt;/td&gt;
&lt;td&gt;= 0.3&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;1.1 * 3&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;3.3000000000000003&lt;/td&gt;
&lt;td&gt;= 3.3&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;10 / 3 * 3&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;10 (the intermediate 10/3 is 3.3333333333333335)&lt;/td&gt;
&lt;td&gt;= 10&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;&lt;code&gt;10 / 3 * 3&lt;/code&gt; comes back to 10 only because the rounding in the final multiplication happens to cancel the error. With floating point, whether an error shows up depends on the numbers, and you cannot tell in advance.&lt;/p&gt;

&lt;p&gt;This is not a bug. Most computers store numbers as binary floating point, and 0.1 has no exact binary representation, so it is slightly off from the start. That part is well known.&lt;/p&gt;

&lt;p&gt;I have been working on a framework I call &lt;strong&gt;B13&lt;/strong&gt;, where every calculation is done with integers, addition, and comparison only. Using that toolkit, I built an everyday scientific calculator.&lt;/p&gt;

&lt;h2&gt;
  
  
  morc calculator
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Code:&lt;/strong&gt; &lt;a href="https://github.com/morcb13-bit/B13-Library/blob/main/HTML/morc_calc_en.html" rel="noopener noreferrer"&gt;morc_mini_en.html on GitHub&lt;/a&gt; &lt;/p&gt;

&lt;p&gt;Calculator: &lt;a href="https://codepen.io/morc_b13-bit/pen/01a1ede0-a27b-72f4-ac1c-672a0d815de0" rel="noopener noreferrer"&gt;https://codepen.io/morc_b13-bit/pen/01a1ede0-a27b-72f4-ac1c-672a0d815de0&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;It is one HTML file. Open it in any browser, on a PC or a phone. Nothing is sent over the network; every calculation runs on your device.&lt;/p&gt;

&lt;p&gt;You type formulas the way you would in Excel. The answer updates as you type, and Enter (or =) saves it to the history.&lt;/p&gt;

&lt;h3&gt;
  
  
  Formula syntax (same as Excel)
&lt;/h3&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;You type&lt;/th&gt;
&lt;th&gt;Meaning&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;
&lt;code&gt;=1+2&lt;/code&gt; or &lt;code&gt;1+2&lt;/code&gt;
&lt;/td&gt;
&lt;td&gt;The leading &lt;code&gt;=&lt;/code&gt; is optional&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;+ - * / ^ %&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Add, subtract, multiply, divide, power, percent (&lt;code&gt;50%&lt;/code&gt; is 0.5). &lt;code&gt;×&lt;/code&gt; and &lt;code&gt;÷&lt;/code&gt; also work&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;
&lt;code&gt;-2^2&lt;/code&gt; is 4&lt;/td&gt;
&lt;td&gt;As in Excel, a leading minus binds tighter than &lt;code&gt;^&lt;/code&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;
&lt;code&gt;2^3^2&lt;/code&gt; is 64&lt;/td&gt;
&lt;td&gt;As in Excel, powers are evaluated left to right&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;SIN(RADIANS(30))&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Trig functions use radians; convert degrees with &lt;code&gt;RADIANS&lt;/code&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;
&lt;code&gt;Ans&lt;/code&gt; key&lt;/td&gt;
&lt;td&gt;Inserts the previous answer&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;26 functions are available:&lt;/p&gt;

&lt;p&gt;&lt;code&gt;SQRT&lt;/code&gt; &lt;code&gt;PI&lt;/code&gt; &lt;code&gt;EXP&lt;/code&gt; &lt;code&gt;LN&lt;/code&gt; &lt;code&gt;LOG10&lt;/code&gt; &lt;code&gt;LOG&lt;/code&gt; &lt;code&gt;SIN&lt;/code&gt; &lt;code&gt;COS&lt;/code&gt; &lt;code&gt;TAN&lt;/code&gt; &lt;code&gt;RADIANS&lt;/code&gt; &lt;code&gt;DEGREES&lt;/code&gt; &lt;code&gt;ROUND&lt;/code&gt; &lt;code&gt;ROUNDUP&lt;/code&gt; &lt;code&gt;ROUNDDOWN&lt;/code&gt; &lt;code&gt;INT&lt;/code&gt; &lt;code&gt;ABS&lt;/code&gt; &lt;code&gt;MOD&lt;/code&gt; &lt;code&gt;QUOTIENT&lt;/code&gt; &lt;code&gt;GCD&lt;/code&gt; &lt;code&gt;LCM&lt;/code&gt; &lt;code&gt;FACT&lt;/code&gt; &lt;code&gt;COMBIN&lt;/code&gt; &lt;code&gt;POWER&lt;/code&gt; &lt;code&gt;SUM&lt;/code&gt; &lt;code&gt;PRODUCT&lt;/code&gt; &lt;code&gt;AVERAGE&lt;/code&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Examples
&lt;/h3&gt;

&lt;p&gt;These are actual outputs of the calculator's engine. "Additions" is the number of additions used to reach the answer.&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Formula&lt;/th&gt;
&lt;th&gt;Answer&lt;/th&gt;
&lt;th&gt;Tag&lt;/th&gt;
&lt;th&gt;Additions&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;=0.1+0.2&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;= 0.3 (fraction 3/10)&lt;/td&gt;
&lt;td&gt;exact&lt;/td&gt;
&lt;td&gt;84&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;=1/3*3&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;= 1&lt;/td&gt;
&lt;td&gt;exact&lt;/td&gt;
&lt;td&gt;45&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;=1/7&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;= 0.(142857) (fraction 1/7)&lt;/td&gt;
&lt;td&gt;exact&lt;/td&gt;
&lt;td&gt;31&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;=SQRT(16/9)&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;= 4/3&lt;/td&gt;
&lt;td&gt;exact&lt;/td&gt;
&lt;td&gt;161&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;=-2^2&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;= 4&lt;/td&gt;
&lt;td&gt;exact&lt;/td&gt;
&lt;td&gt;44&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;=ROUND(-2.5)&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;= −3&lt;/td&gt;
&lt;td&gt;exact&lt;/td&gt;
&lt;td&gt;106&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;=200*15%&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;= 30&lt;/td&gt;
&lt;td&gt;exact&lt;/td&gt;
&lt;td&gt;145&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;=GCD(1071,462)&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;= 21&lt;/td&gt;
&lt;td&gt;exact&lt;/td&gt;
&lt;td&gt;100&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;=123456789*987654321&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;= 121932631112635269&lt;/td&gt;
&lt;td&gt;exact&lt;/td&gt;
&lt;td&gt;443&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;=FACT(30)&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;= 265252859812191058636308480000000&lt;/td&gt;
&lt;td&gt;exact&lt;/td&gt;
&lt;td&gt;718&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;=(1+SQRT(5))/2&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;≈ 1.61803398874989484820…&lt;/td&gt;
&lt;td&gt;approximate (20 digits)&lt;/td&gt;
&lt;td&gt;65,725&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;=2^0.5&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;≈ 1.41421356237309504880…&lt;/td&gt;
&lt;td&gt;approximate (20 digits)&lt;/td&gt;
&lt;td&gt;64,539&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;=EXP(1)&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;≈ 2.718281828459045235360287471352…&lt;/td&gt;
&lt;td&gt;approximate (30 digits)&lt;/td&gt;
&lt;td&gt;24,704&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;=PI()&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;≈ 3.14159265358979323846264338327950288419716939937510…&lt;/td&gt;
&lt;td&gt;approximate (50 digits)&lt;/td&gt;
&lt;td&gt;33,927&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;&lt;code&gt;=SIN(RADIANS(30))&lt;/code&gt; shows ≈ 0.50000000000000000000…. The true value is exactly 1/2, but π was cut off at 32 digits along the way, so the result is tagged approximate. The tag honestly carries the fact that a cutoff happened somewhere.&lt;/p&gt;

&lt;h2&gt;
  
  
  How it works
&lt;/h2&gt;

&lt;h3&gt;
  
  
  Every number is kept as integer ÷ integer
&lt;/h3&gt;

&lt;p&gt;0.1 is stored as 1/10 and 0.2 as 1/5. Their sum is 3/10, so the answer is exactly 0.3. 1/7 stays 1/7, so multiplying by 7 gets you back to 1. Every fraction is reduced with the Euclidean algorithm.&lt;/p&gt;

&lt;p&gt;For display, the fraction is multiplied by a power of 10, divided, and truncated toward zero at the chosen number of digits. Repeating decimals show the repeating part in parentheses.&lt;/p&gt;

&lt;h3&gt;
  
  
  Multiplication and division from addition
&lt;/h3&gt;

&lt;p&gt;Inside, the only operations on numbers are adding and comparing which is larger.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Subtraction&lt;/strong&gt;: flip the sign and add.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Multiplication&lt;/strong&gt; a×b: add a to itself to build a ladder a, 2a, 4a, 8a, …; split b into rungs 1, 2, 4, 8, … and add up the matching rungs of a.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Division&lt;/strong&gt; a÷b: build the ladder b, 2b, 4b, …; from the top, subtract every rung that fits. The rungs you used add up to the quotient; what is left is the remainder.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Times 10&lt;/strong&gt;: build 2x, 4x, 8x by addition, then 8x + 2x.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Square root&lt;/strong&gt;: try adding 1, 2, 4, … (from the top rung down) to the candidate, and keep each one if its square does not exceed the number.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The "ladder" is just long multiplication done in binary.&lt;/p&gt;

&lt;h3&gt;
  
  
  Numbers that never end are tagged "approximate"
&lt;/h3&gt;

&lt;p&gt;For √2, π, e, LN, SIN and other values whose decimals never terminate, the calculator works with integers scaled by a power of 10. It computes 12 more digits than requested, cuts off, and tags the result as approximate.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;π comes from 16·atan(1/5) − 4·atan(1/239), with every term added or subtracted as an integer.&lt;/li&gt;
&lt;li&gt;EXP sums 1 + x + x²/2! + …; LN splits the number into a power of 2 and a value between 1 and 2, then sums a series.&lt;/li&gt;
&lt;li&gt;SIN and COS fold the angle into one turn of 2π, then sum their series.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;If any approximation enters a formula, the answer is tagged approximate. Anything that can be written as a fraction is tagged exact.&lt;/p&gt;

&lt;h3&gt;
  
  
  Balanced number systems
&lt;/h3&gt;

&lt;p&gt;A collapsible panel shows the same answer in balanced ternary (digits −1, 0, +1) and balanced base 13 (digits −6 to +6). Answers with decimals get a radix point there too.&lt;/p&gt;

&lt;p&gt;For example, −1/7 in balanced base 13 is 0.(−2)(+2)(−2)(+2)…. Summing that pattern, which starts at −2/13, gives exactly −1/7.&lt;/p&gt;

&lt;h2&gt;
  
  
  Verification
&lt;/h2&gt;

&lt;p&gt;I fixed the pass criteria before running anything:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Exact formulas&lt;/strong&gt;: pass if the fraction matches exactly and the tag is "exact".&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Approximate formulas&lt;/strong&gt;: pass if the result is within 1 in the 38th decimal place of mpmath (80-digit precision) and the tag is "approximate".&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Invalid formulas&lt;/strong&gt;: pass if the calculator returns an error message instead of an answer. Returning an answer is a fail.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Balanced digits&lt;/strong&gt;: pass if converting the digits back to a number lands within half of the last digit.&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Item&lt;/th&gt;
&lt;th&gt;Cases&lt;/th&gt;
&lt;th&gt;Result&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Exact formulas (arithmetic, %, &lt;code&gt;-2^2&lt;/code&gt;, &lt;code&gt;2^3^2&lt;/code&gt;, ROUND halves, MOD and QUOTIENT with negatives, …)&lt;/td&gt;
&lt;td&gt;28&lt;/td&gt;
&lt;td&gt;all pass&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Approximate formulas (π, e, EXP, LN, LOG, SIN, COS, TAN, fractional powers, …)&lt;/td&gt;
&lt;td&gt;18&lt;/td&gt;
&lt;td&gt;all pass&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Invalid formulas (divide by zero, missing parenthesis, unknown function, LN(0), …)&lt;/td&gt;
&lt;td&gt;7&lt;/td&gt;
&lt;td&gt;all pass&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Balanced ternary and balanced base 13 (π, √2, −e, 22/7, 0.1+0.2, −1/7, −12345)&lt;/td&gt;
&lt;td&gt;14&lt;/td&gt;
&lt;td&gt;all pass&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;A smaller tool built from the same engine (below) was also checked independently by another AI (ChatGPT): multiplication over every pair from −100 to 100, division over every pair from −30 to 30, square roots for 0 to 10,000, and balanced digits for −10,000 to 10,000 all passed, and π, e, √2 and φ matched external values to 200 digits.&lt;/p&gt;

&lt;h2&gt;
  
  
  Counting the additions: morc mini
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Code:&lt;/strong&gt; &lt;a href="https://github.com/morcb13-bit/B13-Library/blob/main/HTML/morc_mini_en.html" rel="noopener noreferrer"&gt;morc_mini_en.html on GitHub&lt;/a&gt; &lt;/p&gt;

&lt;p&gt;Mini: &lt;a href="https://codepen.io/morc_b13-bit/pen/01a1f115-ce16-720d-b8f7-b1ac52ff36cc" rel="noopener noreferrer"&gt;https://codepen.io/morc_b13-bit/pen/01a1f115-ce16-720d-b8f7-b1ac52ff36cc&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;This small version is for watching how many additions an answer takes. When it opens, sample calculations play one after another.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;123456789 × 987654321: 93 additions&lt;/li&gt;
&lt;li&gt;2 to the 100th power: 363 additions&lt;/li&gt;
&lt;li&gt;π to 50 decimal places: 30,542 additions&lt;/li&gt;
&lt;li&gt;π to 100 decimal places: 103,828 additions&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Doubling the digits of π makes the additions grow about 3.4 times, because both the number of terms and the length of each term increase.&lt;/p&gt;

&lt;h2&gt;
  
  
  Where it comes from
&lt;/h2&gt;

&lt;p&gt;The calculator is an appendix to my book &lt;em&gt;Nature Knows Only Addition — Mathematics by Addition Alone, in Moving Figures&lt;/em&gt; (in Japanese, free on Zenn). In the book I build each tool one at a time with addition only; the calculator puts them together for everyday use.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://zenn.dev/link/books/1300fdf2e0ddf7" rel="noopener noreferrer"&gt;https://zenn.dev/link/books/1300fdf2e0ddf7&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The code for the book and the calculator lives in the B13-Library repository on GitHub under the MIT License. Use it, change it, and share it freely.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://github.com/morcb13-bit/B13-Library" rel="noopener noreferrer"&gt;https://github.com/morcb13-bit/B13-Library&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Summary
&lt;/h2&gt;

&lt;p&gt;With floating point, 0.1 + 0.2 and 1.1 × 3 drift in the last digit, while 10 / 3 × 3 happens to come back. Whether an error appears depends on the numbers. If you keep every number as a fraction and limit the operations to addition and comparison, every result lands exactly. 0.1 + 0.2 is exactly 0.3, and 1/7 times 7 is exactly 1. Numbers that never end, such as π and √2, are cut off at the digits you choose, and the calculator says so with a tag.&lt;/p&gt;

&lt;p&gt;Because it carries "exact" and "approximate" separately, the answer itself tells you how far you can trust it. A scientific calculator built from addition alone, with Excel-style formulas, running in any browser and on your phone.&lt;/p&gt;

</description>
      <category>javascript</category>
      <category>math</category>
      <category>webdev</category>
      <category>showdev</category>
    </item>
    <item>
      <title>Elementary Particles Seen Through Discrete Values: Matter, Forces and Generations on the 16-Cell and the 24-Cell</title>
      <dc:creator>MORC</dc:creator>
      <pubDate>Mon, 16 Nov 2026 08:27:19 +0000</pubDate>
      <link>https://dev.to/morc_b13/elementary-particles-seen-through-discrete-values-matter-forces-and-generations-on-the-16-cell-1h23</link>
      <guid>https://dev.to/morc_b13/elementary-particles-seen-through-discrete-values-matter-forces-and-generations-on-the-16-cell-1h23</guid>
      <description>&lt;h2&gt;
  
  
  Introduction
&lt;/h2&gt;

&lt;p&gt;In an earlier article (in Japanese, on Zenn), I placed one generation of quarks and leptons on the eight vertices of the four-dimensional 16-cell. The point there was that a proton cannot be a face of the three-dimensional Sierpinski gasket, yet it becomes a face in four dimensions.&lt;/p&gt;

&lt;p&gt;This article continues from there. On the same eight vertices, I ask:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Where do the forces (bosons) live?&lt;/li&gt;
&lt;li&gt;How are the three generations arranged?&lt;/li&gt;
&lt;li&gt;Where do left and right separate?&lt;/li&gt;
&lt;li&gt;Where does mass appear?&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Everything is counted with integers, addition and comparison only (the numbers shown inside the figures are recounted by the same procedure). Charges are written as integers in units of 1/3 (u = 2, d = −1, e = −3, ν = 0).&lt;/p&gt;

&lt;p&gt;This article does not replace any established theory of elementary particles. It is one viewpoint: what the same world looks like when seen only through discrete values and addresses. The counts below are consistent within the geometric construction; what they mean physically is a separate question, and I mark the places where I am only offering a reading.&lt;/p&gt;




&lt;h2&gt;
  
  
  1. The device: eight vertices and two seats
&lt;/h2&gt;

&lt;p&gt;Write the eight vertices of the 16-cell as (i, s).&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;i = 0 is the lepton axis; i = 1, 2, 3 are the axes of the three colors (red, green, blue)&lt;/li&gt;
&lt;li&gt;s = +1 is the "up" type, s = −1 the "down" type&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;A single formula fixes the charge:&lt;/p&gt;

&lt;p&gt;$$&lt;br&gt;
Q = \frac{3s + c}{2},\qquad c = -3\ (\text{lepton}),\quad c = +1\ (\text{color})&lt;br&gt;
$$&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Vertex&lt;/th&gt;
&lt;th&gt;+ (up type)&lt;/th&gt;
&lt;th&gt;− (down type)&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Axis 0 (lepton)&lt;/td&gt;
&lt;td&gt;ν: 0&lt;/td&gt;
&lt;td&gt;e: −3&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Axes 1–3 (color)&lt;/td&gt;
&lt;td&gt;u: 2&lt;/td&gt;
&lt;td&gt;d: −1&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;Each vertex has a second seat, obtained by flipping the sign of c. I place there the state that I make correspond to the antiparticle: the ν vertex also holds ē (+3), and the u vertex also holds d̄ (+1). This gives 8 vertices × 2 seats = 16 states, all with integer charge. (Charge alone does not make a state an antiparticle; this is a correspondence chosen within the device.)&lt;/p&gt;

&lt;p&gt;The + and − ends of the same axis are antipodal and are not joined by an edge. Every other pair of vertices is joined by an edge (24 edges in total).&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;fig1:The eight vertices of the 16-cell as an octagon&lt;/strong&gt;(fig1_16cell_en.png)&lt;br&gt;
&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fa34mllr2fol7dxw62a1q.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fa34mllr2fol7dxw62a1q.png" alt="fig1:The eight vertices of the 16-cell as an octagon" width="720" height="654"&gt;&lt;/a&gt;&lt;/p&gt;




&lt;h2&gt;
  
  
  2. Forces live in "moves"
&lt;/h2&gt;

&lt;p&gt;Instead of putting bosons on vertices, I put them on &lt;strong&gt;moves from one vertex to another&lt;/strong&gt;. I sorted every move between the eight vertices by how it moves and which axes it connects, and counted the change in charge.&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;How it moves&lt;/th&gt;
&lt;th&gt;Axes&lt;/th&gt;
&lt;th&gt;Change in charge&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;To the antipode (+ ↔ −)&lt;/td&gt;
&lt;td&gt;same axis&lt;/td&gt;
&lt;td&gt;±3 only&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Edge, same sign&lt;/td&gt;
&lt;td&gt;color ↔ color&lt;/td&gt;
&lt;td&gt;0 only&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Edge, same sign&lt;/td&gt;
&lt;td&gt;lepton ↔ color&lt;/td&gt;
&lt;td&gt;±2 only&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Edge, opposite sign&lt;/td&gt;
&lt;td&gt;color ↔ color&lt;/td&gt;
&lt;td&gt;±3&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Edge, opposite sign&lt;/td&gt;
&lt;td&gt;lepton ↔ color&lt;/td&gt;
&lt;td&gt;±1, ±5&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Stay&lt;/td&gt;
&lt;td&gt;—&lt;/td&gt;
&lt;td&gt;0&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;&lt;strong&gt;fig2：Forces live in moves&lt;/strong&gt;(r1_moves_bosons_en.gif)&lt;br&gt;
&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fovtn66ph5ysgs0qnivvp.gif" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fovtn66ph5ysgs0qnivvp.gif" alt="fig2：Forces live in moves" width="720" height="654"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;From this table, the addresses of the forces can be read off.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;W is the move to the antipode.&lt;/strong&gt;&lt;br&gt;
The move to the antipode changes the charge by 3 (that is, by 1) in all 8 cases (4 axes × 2 seats). It is the same 3 for u ↔ d and for ν ↔ e. The change comes only from the 3s part of the formula, so it stays 3 whatever value c takes. That W acts on leptons and quarks with the same charge comes out of the shape of the device.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;The gluon count: color edges plus stays.&lt;/strong&gt;&lt;br&gt;
There are 6 directed edges that move between color axes while keeping the sign. Adding the 3 moves that stay put on a color vertex gives 9. The stay that weights all three colors equally does not distinguish colors, so subtracting it leaves 8. Every one of these changes the charge by 0. This is a match in number with the eight gluons; matching their actual algebra is a further step.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Edges joining lepton and color.&lt;/strong&gt;&lt;br&gt;
There are also 6 directed same-sign edges between the lepton axis and the color axes, and each changes the charge by ±2. It is +2 both for ν → u (the + side) and for e → d (the − side). These moves carry a fractional charge, not a multiple of 3.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Every move is a sum of two parts.&lt;/strong&gt;&lt;br&gt;
For every move, the change in charge splits into&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;a part that moves the sign (W): ±3&lt;/li&gt;
&lt;li&gt;a part that moves the axis: 0 between colors, ±2 between lepton and color&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;On same-sign edges the sign part cancels, so the change was always the same on the + side and the − side.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;The charges of one generation add up to 0.&lt;/strong&gt;&lt;br&gt;
The sign part 3s summed over the 8 vertices is 0, and the axis part c summed over the 4 axes is −3 + 1 + 1 + 1 = 0. Adding all the charges of one generation gives 0. As a control, giving the lepton c = +1 as well makes the sum of c equal to 4, and the cancellation breaks.&lt;/p&gt;




&lt;h2&gt;
  
  
  3. The three generations live inside the 24-cell
&lt;/h2&gt;

&lt;p&gt;The 24 vertices of the 24-cell split exactly into three 16-cells that share no vertex. (Doubling the coordinates: the 8 points ±2eᵢ, the 8 points (±1,±1,±1,±1) with an even number of minus signs, and the 8 with an odd number.) I place one generation in each of the three.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;fig3：The 24-cell split into three 16-cells&lt;/strong&gt;(fig3_24cell_en.png)&lt;br&gt;
&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fe1x0or20t8g47ypso0ui.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fe1x0or20t8g47ypso0ui.png" alt="fig3：The 24-cell split into three 16-cells" width="720" height="654"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Three points with the same name form a triangle.&lt;/strong&gt;&lt;br&gt;
I fixed the arrangement of generation 1 and tried every arrangement of generations 2 and 3 (384 × 384 = 147,456; 384 = 2⁴ × 4! is the order of the symmetry group of the 16-cell). Of these, 168 arrangements make "the three points with the same name (for example u, c, t) form a triangle of the 24-cell, for all eight names". As a control, asking for squared distance 8 instead of a triangle gives 0. What the number 168 means is not explained yet; it is simply the result of the exhaustive search.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Moving by a single rotation: 12 on the left, 12 on the right.&lt;/strong&gt;&lt;br&gt;
Narrowing further to "each generation is reached from the previous one by multiplying all vertices by a single quaternion", 12 arrangements remain for multiplication from the left and 12 for multiplication from the right. The left 12 and the right 12 do not overlap at all. The way generations move also comes in a left family and a right family.&lt;/p&gt;




&lt;h2&gt;
  
  
  4. Left and right: the residue separates them
&lt;/h2&gt;

&lt;h3&gt;
  
  
  The two 1s of Fibonacci are not the same
&lt;/h3&gt;

&lt;p&gt;For neighboring pairs (F(n+1), F(n)) of the Fibonacci sequence, compute&lt;/p&gt;

&lt;p&gt;$$&lt;br&gt;
F(n+1)^2 - F(n+1)F(n) - F(n)^2&lt;br&gt;
$$&lt;/p&gt;

&lt;p&gt;For every n from 1 to 100 it alternates −1, +1, −1, +1, … Already at the first pair (1, 1) it sits on the −1 side. Step by step the pair hops between two hyperbolas and never settles symmetrically. In B13 I call this leftover the residue (zansa).&lt;/p&gt;

&lt;p&gt;As a control, the Lucas numbers starting from 2, 1 give −5, +5, … The residue is ±1 only when the sequence starts from 1, 1.&lt;/p&gt;

&lt;h3&gt;
  
  
  In four dimensions, left and right are the order of multiplication
&lt;/h3&gt;

&lt;p&gt;The eight vertices of the 16-cell can be read directly as ±1, ±i, ±j, ±k (axis 0 = 1, color axes = i, j, k). Over all 8 × 8 products I compared the result of multiplying from the left with the result of multiplying from the right.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;fig4：Multiply from the left, or from the right&lt;/strong&gt;(r2_left_right_en.gif)&lt;br&gt;
&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fllm5tc44gpawewtgsmil.gif" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fllm5tc44gpawewtgsmil.gif" alt="fig4：Multiply from the left, or from the right" width="720" height="654"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Compared set&lt;/th&gt;
&lt;th&gt;Equal&lt;/th&gt;
&lt;th&gt;Differ only by sign&lt;/th&gt;
&lt;th&gt;Other&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;16-cell (8 points)&lt;/td&gt;
&lt;td&gt;40&lt;/td&gt;
&lt;td&gt;24&lt;/td&gt;
&lt;td&gt;0&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Control: 24-cell (24 points)&lt;/td&gt;
&lt;td&gt;168&lt;/td&gt;
&lt;td&gt;24&lt;/td&gt;
&lt;td&gt;384&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Control: plane, ±1, ±i&lt;/td&gt;
&lt;td&gt;16&lt;/td&gt;
&lt;td&gt;0&lt;/td&gt;
&lt;td&gt;0&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;In the 16-cell, the difference between left and right can always be written as a sign (±) alone — the same form as the two-dimensional residue ±1. In the plane the order of multiplication does not matter, so no difference ever appears.&lt;/p&gt;

&lt;h3&gt;
  
  
  The left–right difference is the W difference
&lt;/h3&gt;

&lt;p&gt;Take the 8 vertices v, the same 8 quaternions as multipliers m, and the 2 seats: 8 × 8 × 2 = 128 cases. For each, compare the change in charge of the left move v → mv with that of the right move v → vm. In 48 of the 128 cases they differ, and whenever they differ the gap is exactly ±3 — the W difference. (Counting mismatches of the products themselves gives the same 48: the 24 pairs that differ by sign land on antipodes, and that shifts the charge by 3 in both seats.)&lt;/p&gt;

&lt;p&gt;They differ only when the multiplier is a color axis (i, j, k). Multiplying by the lepton axis (±1) never separates them. Within the device, the distinction between left and right lives on the side of W and color. This is a correspondence inside the model, not a derivation of the Standard Model W boson.&lt;/p&gt;




&lt;h2&gt;
  
  
  5. The string of tetrahedra closes in four dimensions
&lt;/h2&gt;

&lt;p&gt;A string of regular tetrahedra glued face to face twists by an amount that never divides evenly in three dimensions, so it never closes. In four dimensions it closed in two ways.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Inside the 16-cell: strings of 8 cells.&lt;/strong&gt;&lt;br&gt;
Following the 16 cells (tetrahedra) of the 16-cell face to face, every string closed after 8 cells (24 such strings). There are 12 ways to split the 16 cells into two disjoint strings. At each step of a string, one of the four vertices is replaced by its antipode on the same axis. Each step of the string is the same move as W.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Inside the 24-cell: a 6-step string across the generations.&lt;/strong&gt;&lt;br&gt;
I kept multiplying vertices from the left by a quaternion u whose real part is +1/2 (with doubled coordinates, the 8 points (1,±1,±1,±1)). For every such u and every starting vertex, the string&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;closes after 6 steps,&lt;/li&gt;
&lt;li&gt;runs along edges of the 24-cell at all 6 steps, and&lt;/li&gt;
&lt;li&gt;always reaches the antipode at step 3.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;It passes through generation 1 → 2 → 3 → 1 → 2 → 3.&lt;/p&gt;

&lt;p&gt;As a control, a u with real part −1/2 closes after 3 steps but never runs along an edge.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;fig5：A string that closes in 4D&lt;/strong&gt;　(r3_strings_en.gif)&lt;br&gt;
&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Ft7z0w2z5m79gykgciz4v.gif" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Ft7z0w2z5m79gykgciz4v.gif" alt="fig5：A string that closes in 4D" width="720" height="654"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Starting from u (red), the charges read 2, 2, 2, −1, −1, −1. One lap through the three generations turns it into d across a W; the second lap brings it back to u. One lap flips the sign, two laps restore it — the same form as the Fibonacci residue.&lt;/p&gt;




&lt;h2&gt;
  
  
  6. Three generations that differ only in orientation
&lt;/h2&gt;

&lt;h3&gt;
  
  
  Every string is a regular hexagon
&lt;/h3&gt;

&lt;p&gt;In the 3D figure the hexagon looks distorted, but in four dimensions every string is a regular hexagon. Checking with integers, for every string (8 choices of u × 8 vertices):&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;squared distances are 4 between neighbors, 12 one apart, and 16 opposite (the 1 : 3 : 4 of a regular hexagon)&lt;/li&gt;
&lt;li&gt;for any three consecutive vertices, "middle = previous + next" (an addition satisfied only by a flat regular hexagon centered at the origin)&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The strings make 16 regular hexagons in total, which equals the number found by an exhaustive search for regular hexagons in the 24-cell (16). The strings pass through exactly all of them. Each hexagon takes 2 vertices (an antipodal pair) from each of the three 16-cells.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;fig6：A string that closes in 4D, rotating in 3D&lt;/strong&gt;(r3_strings_3d_en.gif)&lt;br&gt;
&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F5lkehvvsq9tqq92nx2ko.gif" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F5lkehvvsq9tqq92nx2ko.gif" alt="fig6：A string that closes in 4D, rotating in 3D" width="720" height="654"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  The shape changes with the direction of the shadow
&lt;/h3&gt;

&lt;p&gt;The three 16-cells are a triple of identical shapes in four dimensions. The only difference is which direction in four dimensions each one faces.&lt;/p&gt;

&lt;p&gt;Cast a shadow into three dimensions, however, and they separate. Projecting along the direction (1, 1, 1, 1):&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Generation&lt;/th&gt;
&lt;th&gt;Vertices in 4D&lt;/th&gt;
&lt;th&gt;Shadow in 3D&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;1&lt;/td&gt;
&lt;td&gt;±2eᵢ&lt;/td&gt;
&lt;td&gt;a cube (8 separate vertices)&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;2&lt;/td&gt;
&lt;td&gt;(±1,±1,±1,±1), even number of −&lt;/td&gt;
&lt;td&gt;an octahedron, plus 2 points ±(1,1,1,1) collapsed at the center&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;3&lt;/td&gt;
&lt;td&gt;odd number of −&lt;/td&gt;
&lt;td&gt;the same cube as generation 1, same size&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;Only the generation aligned with the direction of the shadow collapses into a different shape.&lt;/p&gt;

&lt;p&gt;From here on it is a reading. The three generations, like the electron, muon and tau, share charge and color yet behave differently. Perhaps they are the same thing in four dimensions, seen from three dimensions in different orientations. This article does not address which shadow corresponds to which mass.&lt;/p&gt;




&lt;h2&gt;
  
  
  7. Where mass might sit
&lt;/h2&gt;

&lt;p&gt;This section is a reading, not a counted result.&lt;/p&gt;

&lt;p&gt;Two different geometries sit close together here and should be kept apart: the light cone of spacetime (causal structure), and the mass shell in energy–momentum space. In energy–momentum space (natural units, c = 1), a particle of mass m satisfies E² − p² = m². For m = 0 this is the cone E = |p|, a sharp V; for m &amp;gt; 0 it is a hyperbola, the V with its corner rounded off. Taking the two coordinates along that cone, a = E − p and b = E + p,&lt;/p&gt;

&lt;p&gt;$$&lt;br&gt;
a \times b = m^2&lt;br&gt;
$$&lt;/p&gt;

&lt;p&gt;A hyperbolic rotation (a change of velocity) leaves this product unchanged. Mass 0 means a or b is 0, that is, the point lies on the cone. Mass is "how much the corner of the cone is rounded", and "the product that does not change under rotation". Plotting E against p (p on the horizontal axis, E on the vertical), the curve E(p) = √(p² + m²) bends at p = 0 with curvature 1/m, the same as the parabola m + p²/2m of non-relativistic kinetic energy.&lt;/p&gt;

&lt;p&gt;Applied to the moves of the 16-cell: the massless gluon count runs along edges, while only the massive W moves to the antipode, through the center, off the edges. Whether the reading "a move off the edges ⇔ rounding the corner ⇔ having mass" holds up is one of the next things to count.&lt;/p&gt;




&lt;h2&gt;
  
  
  8. What is not drawn yet
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Fixing the generations: even restricted to a single rotation, 12 placements of the lepton axis remain.&lt;/li&gt;
&lt;li&gt;Separating the photon and the Z: both are on the side of "moves that stay", and I have not decided how to tell them apart.&lt;/li&gt;
&lt;li&gt;The cell string (8 steps) cannot be made by multiplying by a single quaternion; it is a different rotation from the generation string (6 steps). How the two strings combine is open.&lt;/li&gt;
&lt;li&gt;Directions of the shadow: I have not yet counted how many kinds of shadow the three generations fall into from directions other than (1, 1, 1, 1).&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  9. Connections to established language
&lt;/h2&gt;

&lt;p&gt;The counting above is closed inside the device, but in established language it corresponds to the following.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Treating the lepton as a fourth color and lining up four axes is the Pati–Salam arrangement. The charge formula has the form Q = T₃ + (B−L)/2. Extending to four axes, the moves between axes number 12 + 4 − 1 = 15, and the ±2 moves joining lepton and color correspond to leptoquarks (charge 2/3).&lt;/li&gt;
&lt;li&gt;The 8 for gluons is 3 × 3 − 1.&lt;/li&gt;
&lt;li&gt;The split of the 24-cell into three 16-cells is, on the quaternion side, triality.&lt;/li&gt;
&lt;li&gt;The split of four-dimensional rotations into left and right multiplication is written SO(4) ≅ SU(2) × SU(2)/±1.&lt;/li&gt;
&lt;li&gt;The Fibonacci residue ±1 is Cassini's identity; the string of tetrahedra is the Boerdijk–Coxeter helix.&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  Conclusion
&lt;/h2&gt;

&lt;p&gt;With one generation on the eight vertices and two seats of the 16-cell, and the forces on the moves between vertices, W becomes the move to the antipode (change ±3), the gluon count becomes the color edges plus stays (8), and the moves joining lepton and color become ±2. Every change in charge splits into "a part that moves the sign" and "a part that moves the axis", and the charges of one generation add up to 0.&lt;/p&gt;

&lt;p&gt;The three generations sit in the three 16-cells inside the 24-cell. Left and right appeared not as a left and right of shape, but as the order of multiplying quaternions. Their difference has the same sign (±) form as the residue of Fibonacci's 1, 1; in charge it is the ±3 of W, and it lives on the side of color. The string of tetrahedra, which never closes in three dimensions, closes in four dimensions as a regular hexagon that flips after one lap and returns after two. Each hexagon takes two points from each of the three generations, and in four dimensions the three generations do not differ in shape. They differ only in orientation, and only when cast as shadows into three dimensions do they become separate shapes — a cube, or a collapsed octahedron.&lt;/p&gt;

&lt;p&gt;Matter on vertices, forces on moves, generations on the triple of 16-cells, left and right in the order of multiplication. Seen through discrete values and addresses alone, this is how far a picture of the elementary particles can be drawn.&lt;/p&gt;

</description>
      <category>geometry</category>
      <category>python</category>
      <category>showdev</category>
      <category>claude</category>
    </item>
    <item>
      <title>Two Penrose Tilings That Coincide Exactly, from the Same Ten-Pentagon Ring</title>
      <dc:creator>MORC</dc:creator>
      <pubDate>Wed, 12 Aug 2026 06:18:38 +0000</pubDate>
      <link>https://dev.to/morc_b13/two-penrose-tilings-that-coincide-exactly-from-the-same-ten-pentagon-ring-3925</link>
      <guid>https://dev.to/morc_b13/two-penrose-tilings-that-coincide-exactly-from-the-same-ten-pentagon-ring-3925</guid>
      <description>&lt;p&gt;&lt;em&gt;This is part 2. Part 1 introduced the unit — ten regular pentagons in a closed ring — and the two ways two such rings can be joined.&lt;/em&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  The claim, up front
&lt;/h2&gt;

&lt;p&gt;From rings of ten pentagons, &lt;strong&gt;two&lt;/strong&gt; Penrose tilings appear:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;one made of pentagons and rhombi — the figure the rings themselves draw&lt;/li&gt;
&lt;li&gt;another made of pentagons and rhombi — the figure obtained by &lt;strong&gt;joining the ring centres&lt;/strong&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The two coincide exactly, at a scale ratio of φ³.&lt;/p&gt;

&lt;p&gt;And when one of them runs out of moves, the other supplies the next one.&lt;/p&gt;

&lt;p&gt;Every decision is made in integers. Real numbers appear only when drawing to the screen.&lt;/p&gt;




&lt;h2&gt;
  
  
  1. Two rings can be joined in only two ways
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fi9jlctmqei57kiwg6fup.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fi9jlctmqei57kiwg6fup.png" alt="Two ten-pentagon rings joined, showing the two possible sharing patterns" width="800" height="563"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Fig. 1 — Combinations of ten-pentagon rings.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;Take ten regular pentagons of circumradius 1 around a centre. Neighbours share an edge, and a regular decagon is left as a hole in the middle. Call this a &lt;strong&gt;ring&lt;/strong&gt;. Its radius is φ², and the distance between pentagon centres is φ.&lt;/p&gt;

&lt;p&gt;There are only two ways to place two rings.&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Name&lt;/th&gt;
&lt;th&gt;Centre distance&lt;/th&gt;
&lt;th&gt;Pentagons shared&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;adjacent&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;φ²·|ζ⁴−1| ≈ 4.9798&lt;/td&gt;
&lt;td&gt;two neighbouring&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;skip&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;φ²·|ζ²−1| ≈ 3.0777&lt;/td&gt;
&lt;td&gt;two with two between them&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;The ratio is exactly φ. These two, and nothing else, are used to grow the figure outward while keeping five-fold rotational symmetry. That is the whole construction.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;On vocabulary.&lt;/strong&gt; This article is written in the words of the construction itself — ring, address, adjacent, skip, pentagram. The correspondence with existing mathematics (Penrose tilings, inflation) is deferred to §10, where it is labelled as such.&lt;/p&gt;
&lt;/blockquote&gt;




&lt;h2&gt;
  
  
  2. Address and orientation
&lt;/h2&gt;

&lt;p&gt;The orientation of a pentagon is fixed by its bearing from the ring centre and nothing else. Call the pentagon in the k-th direction &lt;strong&gt;address k&lt;/strong&gt;; its orientation depends only on the parity of k. There is no further freedom.&lt;/p&gt;

&lt;p&gt;A ring maps onto itself under a 36° rotation, so a ring carries no rotational freedom of its own. &lt;strong&gt;A ring is determined by its centre coordinate alone.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Addresses sit directly on the phase integers of b13phase:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;BASE = 3120 = 60 × 52
36° = 312 = 6 × STEP_MIN
address k → phase k × 312
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h2&gt;
  
  
  3. Two tilings
&lt;/h2&gt;

&lt;p&gt;Two Penrose tilings can be drawn.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F7wpped90ph2vrbq5yao7.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F7wpped90ph2vrbq5yao7.png" alt="Two tilings from ten-pentagon rings: left, skip connection with a pentagon at the centre; right, adjacent connection with a pentagram at the centre" width="800" height="409"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Fig. 2 — First layer. **A&lt;/em&gt;* (left): skip connections, a pentagon at the centre. &lt;strong&gt;B&lt;/strong&gt; (right): adjacent connections, a pentagram at the centre.*&lt;/p&gt;

&lt;p&gt;Inside &lt;strong&gt;2-B&lt;/strong&gt; a &lt;strong&gt;pentagram&lt;/strong&gt; appears — the star-shaped gap enclosed by five pentagons. There is a strong rule here, so this is the side to follow first.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Around a pentagram, five rings appear, of exactly the same form as the first layer.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;As an integer identity, with g the centre of the pentagram:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;enclosing pentagons     g + φ  · ζ^(k+2i)     (address parity is (k+1) mod 2)
enclosing ring centres  g + φ³ · ζ^(k+2i)     (i = 0..4)
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The first layer is this rule with g = 0.&lt;/p&gt;

&lt;p&gt;Turning the rule takes the rings from 25 → 45 → 55, and the pentagrams from 6 → 16 → 21. &lt;strong&gt;The rule then stops.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;The reason it stops is plain. At 55 rings, all 21 pentagrams are already fully enclosed by five rings each. The number of new rings the rule demands is zero. Nothing here is computationally hard; the rule simply has no work left.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fbkmw09i9nuhs0mvn4g13.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fbkmw09i9nuhs0mvn4g13.png" alt="growth from the pentagram-centred figure" width="504" height="516"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Fig. 3 — Growth of the pentagram-centred figure.&lt;/em&gt;&lt;/p&gt;




&lt;h2&gt;
  
  
  4. Joining the ring centres
&lt;/h2&gt;

&lt;p&gt;The rings were being laid down; but looking only at their centres, a different tiling appears.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Take the ring centres alone and join them with lines.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;What appears is another tiling. The pentagons were placed. The rhombi were not — they are simply what the ring centres leave between them.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;regular pentagons: circumradius φ³, every edge an adjacent connection&lt;/li&gt;
&lt;li&gt;rhombi: edge φ³·|ζ²−1|, short diagonal a skip connection&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;And &lt;strong&gt;the centroid of each regular pentagon lands exactly on a pentagram of the original figure&lt;/strong&gt;. Where a star was, a large pentagon arrives.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;A skip connection is the &lt;strong&gt;short diagonal&lt;/strong&gt; of one of these rhombi. If skip connections are drawn as edges when taking the faces of the centre figure, each rhombus splits into two triangles. Take the faces using adjacent connections only.&lt;/p&gt;
&lt;/blockquote&gt;




&lt;h2&gt;
  
  
  5. The rhombi face the centre
&lt;/h2&gt;

&lt;p&gt;There is one further condition on the construction.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Within a layer, the skip connections do not overlap. Under this condition every rhombus points toward the centre coordinate.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;The centroid of a rhombus is the midpoint of two rings, and its long axis is always perpendicular to the connection vector. So:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;long axis points at the centre ⟺ (C₂−C₁) ⊥ (C₁+C₂) ⟺ |C₁| = |C₂|
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Two rings joined by a skip connection must have equal radius.&lt;/strong&gt; This is what defines a layer.&lt;/p&gt;

&lt;p&gt;The condition is not cosmetic. Building the figure without it and comparing:&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;&lt;/th&gt;
&lt;th&gt;Faces of the centre figure&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;condition held&lt;/td&gt;
&lt;td&gt;closes with 21 regular pentagons + 10 rhombi&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;condition broken&lt;/td&gt;
&lt;td&gt;15 rhombi / 41 pentagons / &lt;strong&gt;five 15-gons&lt;/strong&gt; / five invalid pentagons&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;Breaking it wrecks the centre figure: 15-gons appear, which no Penrose tiling contains.&lt;/p&gt;

&lt;p&gt;And the condition is &lt;strong&gt;stronger than mirror symmetry&lt;/strong&gt; — the broken figure was still closed under reflection. Symmetry alone is not enough.&lt;/p&gt;




&lt;h2&gt;
  
  
  6. Getting past the dead end
&lt;/h2&gt;

&lt;p&gt;![Sixty rings with all ten large rhombi completed]&lt;br&gt;
&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fn16z7gr0v4ub61c1ieqn.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fn16z7gr0v4ub61c1ieqn.png" alt=" " width="800" height="801"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Fig. 4 — 60 rings and the completed large rhombi.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;At 55 rings the growth rule is exhausted. So look at the centre figure instead.&lt;/p&gt;

&lt;p&gt;Only &lt;strong&gt;five&lt;/strong&gt; of the large rhombi were complete. The five skip-connected pairs at radius 15.8262 were each missing one vertex.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;That missing vertex is the next ring centre.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;It is pinned down by an integer identity:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;C_new = a + φ²(ζ⁴−1)·ζ^k     (choose the k that also makes an adjacent connection from b)
→ five points at radius 20.5623
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;The point is unique.&lt;/strong&gt; Over Z[ζ₁₀] there are always exactly two points adjacent-connected to both a and b — the two vertices of the rhombus. For the five completed pairs both are already in the figure; for the five incomplete pairs one already is, so the missing one is determined. That point also satisfies the address-parity condition and the zero-overlap condition. There is no choice to make.&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;&lt;/th&gt;
&lt;th&gt;55 rings&lt;/th&gt;
&lt;th&gt;→&lt;/th&gt;
&lt;th&gt;60 rings&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;rings&lt;/td&gt;
&lt;td&gt;55&lt;/td&gt;
&lt;td&gt;&lt;/td&gt;
&lt;td&gt;60&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;pentagons&lt;/td&gt;
&lt;td&gt;385&lt;/td&gt;
&lt;td&gt;&lt;/td&gt;
&lt;td&gt;420&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;large rhombi&lt;/td&gt;
&lt;td&gt;5 (5 pairs incomplete)&lt;/td&gt;
&lt;td&gt;&lt;/td&gt;
&lt;td&gt;&lt;strong&gt;all 10 complete&lt;/strong&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;overlaps&lt;/td&gt;
&lt;td&gt;0&lt;/td&gt;
&lt;td&gt;&lt;/td&gt;
&lt;td&gt;0&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;address-parity mismatches&lt;/td&gt;
&lt;td&gt;0&lt;/td&gt;
&lt;td&gt;&lt;/td&gt;
&lt;td&gt;0&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;skip pairs of unequal radius&lt;/td&gt;
&lt;td&gt;0&lt;/td&gt;
&lt;td&gt;&lt;/td&gt;
&lt;td&gt;0&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;&lt;strong&gt;Two rules alternate.&lt;/strong&gt; When the rule that places rings around pentagrams runs out, the rule that fills the gaps in the large rhombi produces the next step. Where one stops, the other moves.&lt;/p&gt;




&lt;h2&gt;
  
  
  7. The two figures coincide
&lt;/h2&gt;

&lt;p&gt;By now the point of Fig. 2-A and Fig. 2-B may already be visible: they are the same figure at different scales.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fa7hy3ac142a9y564tg5g.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fa7hy3ac142a9y564tg5g.png" alt="The pentagon-centred tiling grown to 55 rings and 385 pentagons" width="800" height="800"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Fig. 5 — The pentagon-centred tiling (Fig. 2-A) grown out: 55 rings, 385 pentagons.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;Overlay the two at 60 rings.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fzqdgt8vjj9sxagz7c5pg.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fzqdgt8vjj9sxagz7c5pg.png" alt="The two tilings overlaid, showing their vertices coinciding" width="800" height="800"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Fig. 6 — The two tilings overlaid.&lt;/em&gt;&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Centre figure&lt;/th&gt;
&lt;th&gt;Original figure&lt;/th&gt;
&lt;th&gt;Count&lt;/th&gt;
&lt;th&gt;Match&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;pentagon centroids&lt;/td&gt;
&lt;td&gt;pentagrams&lt;/td&gt;
&lt;td&gt;21 ↔ 21&lt;/td&gt;
&lt;td&gt;&lt;strong&gt;integer tuples identical&lt;/strong&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;rhombus centres&lt;/td&gt;
&lt;td&gt;thin rhombi&lt;/td&gt;
&lt;td&gt;10 ↔ 10&lt;/td&gt;
&lt;td&gt;&lt;strong&gt;integer tuples identical&lt;/strong&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;This match is not read off the picture, and it is not a floating-point tolerance. Centroids are held as integer 4-tuples scaled by 5, rhombus centres as the sum of a skip pair, and they are compared with &lt;code&gt;==&lt;/code&gt; without rounding.&lt;/p&gt;

&lt;p&gt;Scale ratio:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;pentagon circumradius   4.236068 / 1        = 4.236068
rhombus edge            4.979797 / 1.175571 = 4.236066
                                       φ³ = 4.236068
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;The small rhombus sits exactly inside the large one.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Measured from the same pentagram, the ladder of powers of φ is visible directly:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;five pentagon centres around a pentagram …… radius φ
                                          …… radius φ²
                                          …… radius φ³
five ring centres around a pentagram      …… radius φ³   ← lands on the third rung
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h2&gt;
  
  
  8. Writing it with integers only
&lt;/h2&gt;

&lt;p&gt;With real coordinates, overlap detection needs a threshold, and thresholds stop working as the figure grows. So the whole thing is written in integers from the start.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Coordinates&lt;/strong&gt; are integer 4-tuples over Z[ζ₁₀], with ζ = e^{iπ/5}:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="n"&gt;Zeta&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nb"&gt;tuple&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="nb"&gt;int&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nb"&gt;int&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nb"&gt;int&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nb"&gt;int&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;     &lt;span class="c1"&gt;# a + bζ + cζ² + dζ³
&lt;/span&gt;&lt;span class="n"&gt;PHI&lt;/span&gt;  &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;                 &lt;span class="c1"&gt;# φ, with φ² − φ − 1 = 0 exactly
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Reduce with ζ⁴ = −1 + ζ − ζ² + ζ³. Multiplication is an integer convolution and nothing more.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Distances&lt;/strong&gt; are held as squared lengths, as integer pairs (p, q) = p + qφ over Z[φ]. Two distances are equal iff &lt;strong&gt;the tuples are equal&lt;/strong&gt;. No approximation enters.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;norm2&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;a&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;Zeta&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;-&amp;gt;&lt;/span&gt; &lt;span class="nb"&gt;tuple&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="nb"&gt;int&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nb"&gt;int&lt;/span&gt;&lt;span class="p"&gt;]:&lt;/span&gt;
    &lt;span class="n"&gt;z&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;zmul&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;a&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nf"&gt;zconj&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;a&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt;
    &lt;span class="k"&gt;assert&lt;/span&gt; &lt;span class="n"&gt;z&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;==&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt; &lt;span class="ow"&gt;and&lt;/span&gt; &lt;span class="n"&gt;z&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="mi"&gt;3&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;==&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="n"&gt;z&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;      &lt;span class="c1"&gt;# realness falls out structurally
&lt;/span&gt;    &lt;span class="nf"&gt;return &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;z&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="n"&gt;z&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="p"&gt;],&lt;/span&gt; &lt;span class="n"&gt;z&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="p"&gt;])&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;That &lt;code&gt;assert&lt;/code&gt; is not a sanity check but a structural statement. Multiplying by the conjugate kills the imaginary part by construction, so the squared length necessarily lands in the real subfield Z[φ]. Its basis there is 1 and φ, which is exactly why &lt;code&gt;z[1] == 0 and z[3] == -z[2]&lt;/code&gt; holds and the coefficients (p, q) can be read straight out.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Comparison&lt;/strong&gt; also closes over the integers. Since 2(p+qφ) = (2p+q) + q√5, the sign is decided by comparing (2p+q)² against 5q².&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;phi_sign&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;x&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt;
    &lt;span class="n"&gt;A&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;B&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="o"&gt;*&lt;/span&gt;&lt;span class="n"&gt;x&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="n"&gt;x&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;],&lt;/span&gt; &lt;span class="n"&gt;x&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;
    &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="n"&gt;A&lt;/span&gt; &lt;span class="o"&gt;==&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt; &lt;span class="ow"&gt;and&lt;/span&gt; &lt;span class="n"&gt;B&lt;/span&gt; &lt;span class="o"&gt;==&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;
    &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="n"&gt;A&lt;/span&gt; &lt;span class="o"&gt;&amp;gt;=&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt; &lt;span class="ow"&gt;and&lt;/span&gt; &lt;span class="n"&gt;B&lt;/span&gt; &lt;span class="o"&gt;&amp;gt;=&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;
    &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="n"&gt;A&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;=&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt; &lt;span class="ow"&gt;and&lt;/span&gt; &lt;span class="n"&gt;B&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;=&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;
    &lt;span class="nf"&gt;return &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt; &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="n"&gt;A&lt;/span&gt;&lt;span class="o"&gt;*&lt;/span&gt;&lt;span class="n"&gt;A&lt;/span&gt; &lt;span class="o"&gt;&amp;gt;&lt;/span&gt; &lt;span class="mi"&gt;5&lt;/span&gt;&lt;span class="o"&gt;*&lt;/span&gt;&lt;span class="n"&gt;B&lt;/span&gt;&lt;span class="o"&gt;*&lt;/span&gt;&lt;span class="n"&gt;B&lt;/span&gt; &lt;span class="k"&gt;else&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="n"&gt;A&lt;/span&gt; &lt;span class="o"&gt;&amp;gt;&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt; &lt;span class="nf"&gt;else &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt; &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="n"&gt;A&lt;/span&gt;&lt;span class="o"&gt;*&lt;/span&gt;&lt;span class="n"&gt;A&lt;/span&gt; &lt;span class="o"&gt;&amp;gt;&lt;/span&gt; &lt;span class="mi"&gt;5&lt;/span&gt;&lt;span class="o"&gt;*&lt;/span&gt;&lt;span class="n"&gt;B&lt;/span&gt;&lt;span class="o"&gt;*&lt;/span&gt;&lt;span class="n"&gt;B&lt;/span&gt; &lt;span class="k"&gt;else&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Orientation&lt;/strong&gt; uses the b13phase phase integers with BASE = 3120: address k → k × 312.&lt;/p&gt;

&lt;p&gt;Real numbers are used only to order the faces cyclically, and to draw. Never to decide anything.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;The &lt;code&gt;constants.py&lt;/code&gt; of b13phase states that where a calculation needs closure under φ, Z[ζ₁₀] must be used rather than BASE-unit rounded integers. This implementation follows that: phase (orientation) from b13phase, coordinates from Z[ζ₁₀].&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Verification output:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="n"&gt;composition&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="s"&gt;rings&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;60&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="s"&gt;pentagons&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;420&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="s"&gt;pentagrams&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;21&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;

  &lt;span class="n"&gt;overlaps&lt;/span&gt; &lt;span class="o"&gt;==&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;                        &lt;span class="bp"&gt;True&lt;/span&gt;
  &lt;span class="n"&gt;parity&lt;/span&gt; &lt;span class="n"&gt;mismatches&lt;/span&gt; &lt;span class="o"&gt;==&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;               &lt;span class="bp"&gt;True&lt;/span&gt;
  &lt;span class="n"&gt;skip&lt;/span&gt; &lt;span class="n"&gt;pairs&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;                           &lt;span class="mi"&gt;10&lt;/span&gt;
  &lt;span class="nb"&gt;all&lt;/span&gt; &lt;span class="n"&gt;equal&lt;/span&gt; &lt;span class="n"&gt;radius&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;                     &lt;span class="bp"&gt;True&lt;/span&gt;
  &lt;span class="n"&gt;faces&lt;/span&gt; &lt;span class="n"&gt;of&lt;/span&gt; &lt;span class="n"&gt;centre&lt;/span&gt; &lt;span class="n"&gt;figure&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;               &lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="s"&gt;pentagon&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;21&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="s"&gt;rhombus&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;10&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;
  &lt;span class="n"&gt;pentagon&lt;/span&gt; &lt;span class="n"&gt;centroids&lt;/span&gt; &lt;span class="o"&gt;==&lt;/span&gt; &lt;span class="n"&gt;pentagrams&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;     &lt;span class="bp"&gt;True&lt;/span&gt;
  &lt;span class="n"&gt;rhombus&lt;/span&gt; &lt;span class="n"&gt;centres&lt;/span&gt; &lt;span class="o"&gt;==&lt;/span&gt; &lt;span class="n"&gt;thin&lt;/span&gt; &lt;span class="n"&gt;rhombi&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;       &lt;span class="bp"&gt;True&lt;/span&gt;
  &lt;span class="n"&gt;squared&lt;/span&gt; &lt;span class="n"&gt;edge&lt;/span&gt; &lt;span class="n"&gt;length&lt;/span&gt; &lt;span class="n"&gt;of&lt;/span&gt; &lt;span class="n"&gt;rhombus&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;       &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;7&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;11&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
  &lt;span class="n"&gt;φ&lt;/span&gt;&lt;span class="err"&gt;⁶&lt;/span&gt; &lt;span class="err"&gt;×&lt;/span&gt; &lt;span class="n"&gt;small&lt;/span&gt; &lt;span class="n"&gt;rhombus&lt;/span&gt; &lt;span class="n"&gt;edge&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;              &lt;span class="bp"&gt;True&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;code&gt;(7, 11)&lt;/code&gt; means 7 + 11φ. That equals φ⁶ times the edge of the small rhombus, as an integer identity.&lt;/p&gt;




&lt;h2&gt;
  
  
  9. Connecting to b13phase (BASE = 3120)
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Every structural angle lands on a lattice of 156 BASE units.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Expressing all bearings in BASE units — the 10 connection directions, the 10 ring-to-pentagon directions, the 5 pentagram-to-ring directions — gives the 20 values &lt;code&gt;{0, 156, 312, 468, …, 2964}&lt;/code&gt;. Their greatest common divisor is exactly &lt;strong&gt;156&lt;/strong&gt;, and 3120 ÷ 156 = 20, which divides.&lt;/p&gt;

&lt;p&gt;The quantum of angle turned out to be a multiple of 13 throughout.&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;&lt;/th&gt;
&lt;th&gt;BASE units&lt;/th&gt;
&lt;th&gt;&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;6° (STEP_MIN)&lt;/td&gt;
&lt;td&gt;52&lt;/td&gt;
&lt;td&gt;= 4 × 13&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;18° (connection-direction step)&lt;/td&gt;
&lt;td&gt;156&lt;/td&gt;
&lt;td&gt;= &lt;strong&gt;12 × 13&lt;/strong&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;36° (one address)&lt;/td&gt;
&lt;td&gt;312&lt;/td&gt;
&lt;td&gt;= 24 × 13&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;72° (five-fold)&lt;/td&gt;
&lt;td&gt;624&lt;/td&gt;
&lt;td&gt;= 48 × 13&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;360°&lt;/td&gt;
&lt;td&gt;3120&lt;/td&gt;
&lt;td&gt;= 240 × 13&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;The angular lattice on the Penrose side is a 20-fold division (18° steps), and it divides 3120 by 156, leaving a cofactor of 12·13.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;And the newly derived layer landed exactly on it.&lt;/strong&gt; Of the 60 ring centres, only 20 have a bearing that is a BASE integer. In squared radius these are &lt;code&gt;(5,8)=φ⁶&lt;/code&gt;, &lt;code&gt;(34,55)=φ¹⁰&lt;/code&gt;, &lt;code&gt;(52,84)&lt;/code&gt;, and &lt;strong&gt;&lt;code&gt;(117,189)&lt;/code&gt;&lt;/strong&gt; — that last one being the five points at radius 20.5623 derived by filling the gaps in the large rhombi. Their bearings are multiples of 312, that is, exact multiples of 36°. They fall on the side that sits on the b13phase lattice.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fl5mfwx8km5cm3pitxmfh.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fl5mfwx8km5cm3pitxmfh.png" alt="The figure overlaid with the b13phase angular lattice" width="800" height="858"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Fig. 7 — Overlay with b13phase.&lt;/em&gt;&lt;/p&gt;




&lt;h2&gt;
  
  
  10. What is obvious here, and what is not
&lt;/h2&gt;

&lt;p&gt;Drawing the line honestly.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;The obvious side.&lt;/strong&gt; That two figures coincide at a scale ratio is the self-similarity (inflation) of Penrose tilings itself. The correspondence putting a higher-level pentagon where a star was is a known composition rule. Nothing mathematically surprising is happening.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;The precise form of "necessary in order to continue".&lt;/strong&gt; The condition that rhombi face the centre is &lt;em&gt;not&lt;/em&gt; necessary for the tiling to continue. Even in the figure that broke the condition, pentagon overlap was zero. What the condition is necessary for is continuing &lt;strong&gt;while preserving self-similarity&lt;/strong&gt; — keeping the property that the centre figure remains a tiling and keeps supplying the next layer. And in fact the layer after 60 rings came only from this condition.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;The non-obvious side.&lt;/strong&gt; The unit — a ring of ten pentagons — was not defined from Penrose theory. It was found by drawing. That the ring centres, a &lt;em&gt;derived&lt;/em&gt; set of points, land &lt;strong&gt;exactly&lt;/strong&gt; on the vertices of the higher tiling was not knowable until it was checked.&lt;/p&gt;




&lt;h2&gt;
  
  
  11. Attribution
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Construction, observation, and the rules found&lt;/strong&gt; — all from drawing, by the author. The ring as a unit; the two connection types, skip and adjacent; the condition that rhombi face the centre; the idea of joining the ring centres; and the plan of getting the next layer out of it.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Checking, counterexamples, and integerisation&lt;/strong&gt; — the AI (Claude). Building the figure that breaks the condition and showing the centre figure wrecked; confirming the zero-error match; the implementation over Z[ζ₁₀].&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;This division of labour worked in one direction only. Every attempt to swap the roles — to have the AI aim and the author check — missed.&lt;/p&gt;




&lt;h2&gt;
  
  
  Code
&lt;/h2&gt;

&lt;p&gt;Everything is in &lt;code&gt;b13_two_tilings.py&lt;/code&gt;. Place b13phase v0.6.9 at the same level and run it.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://github.com/morcb13-bit/Paper/blob/main/2026-07-26-penrose/b13_two_tilings.py" rel="noopener noreferrer"&gt;https://github.com/morcb13-bit/Paper/blob/main/2026-07-26-penrose/b13_two_tilings.py&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://github.com/morcb13-bit/Paper/blob/main/2026-07-26-penrose/b13phase_v069.zip" rel="noopener noreferrer"&gt;https://github.com/morcb13-bit/Paper/blob/main/2026-07-26-penrose/b13phase_v069.zip&lt;/a&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;b13_two_tilings.py
b13phase_v069/
    b13phase/
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;





&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;python3 b13_two_tilings.py
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h2&gt;
  
  
  What comes next
&lt;/h2&gt;

&lt;p&gt;At 60 rings the skip pairs stay at 10 and stop increasing, so the large rhombi all complete and the figure halts again. The next question is &lt;strong&gt;what mechanism produces new skip pairs&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;This figure is intended as the base figure of a computing structure — the pentagon processor — with rings as computing units, pentagons as internal phase and memory cells, and the connections between rings as channels. That is for a separate article.&lt;/p&gt;

</description>
      <category>geometry</category>
      <category>ai</category>
      <category>science</category>
    </item>
    <item>
      <title>Penrose figure: Where B13 Started, and the Figure the AI Couldn't Draw</title>
      <dc:creator>MORC</dc:creator>
      <pubDate>Tue, 11 Aug 2026 01:10:21 +0000</pubDate>
      <link>https://dev.to/morc_b13/ten-pentagons-in-a-ring-where-b13-started-and-the-figure-the-ai-couldnt-draw-4bid</link>
      <guid>https://dev.to/morc_b13/ten-pentagons-in-a-ring-where-b13-started-and-the-figure-the-ai-couldnt-draw-4bid</guid>
      <description>&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fjrskj5qsezmmrrpecgtf.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fjrskj5qsezmmrrpecgtf.png" alt=" " width="374" height="370"&gt;&lt;/a&gt;&lt;/p&gt;




&lt;h2&gt;
  
  
  It started on paper
&lt;/h2&gt;

&lt;p&gt;![Hand-drawn arrangement of ten pentagons forming a ring, central portion]&lt;br&gt;
&lt;em&gt;Fig. 1 — Ten pentagons laid out by hand.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;B13 did not start from a theorem or a conjecture. It started from a figure: ten pentagons arranged in a ring.&lt;/p&gt;

&lt;p&gt;Lay ten regular pentagons edge to edge in a closed loop and a hole opens in the middle. Line several of these rings up and a pentagram stands at the centre. Making that the core of a processor — that idea was there from the beginning. In February 2026 I confirmed it by hand and in CAD. The realisation that the ring closes in &lt;strong&gt;balanced quinary&lt;/strong&gt; — where stepping back two becomes the addition of a negative digit — also happened on paper, not with an AI.&lt;/p&gt;

&lt;p&gt;From there came the residue, then the landing, then the address, and eventually the B13 of today. Having gone as deep into number theory as this has, it is easy to forget: the material was ten pentagons from the start.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Note on vocabulary: &lt;em&gt;residue&lt;/em&gt;, &lt;em&gt;landing&lt;/em&gt; and &lt;em&gt;address&lt;/em&gt; are terms of this framework, not the standard number-theoretic ones. They are defined in a later post in this series. Nothing here is reduced modulo anything.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;h2&gt;
  
  
  The figure the AI could not draw
&lt;/h2&gt;

&lt;p&gt;By hand, this structure goes forward. Probably forever.&lt;/p&gt;

&lt;p&gt;An AI could not draw it. The generated figures broke down partway through, the connections could not be turned into numbers, and the pentagons came out either overlapping or full of gaps. Without an exact path that can be sent to a printer, nothing moves. That was the limit of what AI could do at the time, and the matter was closed.&lt;/p&gt;

&lt;p&gt;This time I put the same question again. What follows is the record of that attempt.&lt;/p&gt;

&lt;p&gt;Some of the failures:&lt;/p&gt;



&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fsa5kbnswwfzzffjo9hl2.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fsa5kbnswwfzzffjo9hl2.png" alt=" " width="800" height="800"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fht6p0f0i88422px5kd43.webp" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fht6p0f0i88422px5kd43.webp" alt=" " width="800" height="800"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F9kwbrtde5ab0rbcv106d.webp" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F9kwbrtde5ab0rbcv106d.webp" alt=" " width="800" height="800"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;h2&gt;
  
  
  AI is bad at seeing shapes
&lt;/h2&gt;

&lt;p&gt;The first thing that turned up was that the AI's own definition of the ring was wrong.&lt;/p&gt;

&lt;p&gt;It had been setting the ring radius so that the centre-to-centre distance between neighbouring pentagons equalled the &lt;strong&gt;edge length&lt;/strong&gt;. But when two pentagons share an edge, the distance between their centres is not the edge length. It is twice the inradius.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;Observer's note&lt;/strong&gt; — labelled as borrowed knowledge:&lt;br&gt;
For a regular pentagon with circumradius 1, the inradius is 

&lt;/p&gt;
&lt;div class="katex-element"&gt;
  &lt;span class="katex-display"&gt;&lt;span class="katex"&gt;&lt;span class="katex-mathml"&gt;&lt;/span&gt;&lt;span class="katex-html"&gt;&lt;span class="base"&gt;&lt;span class="strut"&gt;&lt;/span&gt;&lt;span class="mop"&gt;cos&lt;/span&gt;&lt;span class="mopen"&gt;(&lt;/span&gt;&lt;span class="mord mathnormal"&gt;π&lt;/span&gt;&lt;span class="mord"&gt;/5&lt;/span&gt;&lt;span class="mclose"&gt;)&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;/div&gt;
. If an edge is shared, the centre-to-centre distance is 
&lt;div class="katex-element"&gt;
  &lt;span class="katex-display"&gt;&lt;span class="katex"&gt;&lt;span class="katex-mathml"&gt;&lt;/span&gt;&lt;span class="katex-html"&gt;&lt;span class="base"&gt;&lt;span class="strut"&gt;&lt;/span&gt;&lt;span class="mord"&gt;2&lt;/span&gt;&lt;span class="mspace"&gt;&lt;/span&gt;&lt;span class="mop"&gt;cos&lt;/span&gt;&lt;span class="mopen"&gt;(&lt;/span&gt;&lt;span class="mord mathnormal"&gt;π&lt;/span&gt;&lt;span class="mord"&gt;/5&lt;/span&gt;&lt;span class="mclose"&gt;)&lt;/span&gt;&lt;span class="mspace"&gt;&lt;/span&gt;&lt;span class="mrel"&gt;=&lt;/span&gt;&lt;span class="mspace"&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="base"&gt;&lt;span class="strut"&gt;&lt;/span&gt;&lt;span class="mord mathnormal"&gt;φ&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;/div&gt;
.&lt;br&gt;
For ten of them in a ring, the ring radius is 
&lt;div class="katex-element"&gt;
  &lt;span class="katex-display"&gt;&lt;span class="katex"&gt;&lt;span class="katex-mathml"&gt;&lt;/span&gt;&lt;span class="katex-html"&gt;&lt;span class="base"&gt;&lt;span class="strut"&gt;&lt;/span&gt;&lt;span class="mord mathnormal"&gt;φ&lt;/span&gt;&lt;span class="mord"&gt;/&lt;/span&gt;&lt;span class="mopen"&gt;(&lt;/span&gt;&lt;span class="mord"&gt;2&lt;/span&gt;&lt;span class="mspace"&gt;&lt;/span&gt;&lt;span class="mop"&gt;sin&lt;/span&gt;&lt;span class="mopen"&gt;(&lt;/span&gt;&lt;span class="mord mathnormal"&gt;π&lt;/span&gt;&lt;span class="mord"&gt;/10&lt;/span&gt;&lt;span class="mclose"&gt;))&lt;/span&gt;&lt;span class="mspace"&gt;&lt;/span&gt;&lt;span class="mrel"&gt;=&lt;/span&gt;&lt;span class="mspace"&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="base"&gt;&lt;span class="strut"&gt;&lt;/span&gt;&lt;span class="mord"&gt;&lt;span class="mord mathnormal"&gt;φ&lt;/span&gt;&lt;span class="msupsub"&gt;&lt;span class="vlist-t"&gt;&lt;span class="vlist-r"&gt;&lt;span class="vlist"&gt;&lt;span&gt;&lt;span class="pstrut"&gt;&lt;/span&gt;&lt;span class="sizing reset-size6 size3 mtight"&gt;&lt;span class="mord mtight"&gt;2&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;/div&gt;
.
&lt;/blockquote&gt;

&lt;p&gt;While that error was in place, 20% of each generated pentagon's area was overlapping its neighbour. They were being laid down on top of each other, so of course the figure could not be continued.&lt;/p&gt;

&lt;p&gt;The correct ratio was confirmed against an earlier broken figure — the one with the gaps — by measuring it in pixels. With a correction for the cell area coming out small by the width of the drawn line, the centre-to-centre distance inside the ring matched 1.618.&lt;/p&gt;

&lt;p&gt;So the correct ring is:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;ten pentagons, neighbours sharing an edge&lt;/li&gt;
&lt;li&gt;ring radius 
&lt;div class="katex-element"&gt;
  &lt;span class="katex-display"&gt;&lt;span class="katex"&gt;&lt;span class="katex-mathml"&gt;&lt;/span&gt;&lt;span class="katex-html"&gt;&lt;span class="base"&gt;&lt;span class="strut"&gt;&lt;/span&gt;&lt;span class="mord mathnormal"&gt;R&lt;/span&gt;&lt;span class="mspace"&gt;&lt;/span&gt;&lt;span class="mrel"&gt;=&lt;/span&gt;&lt;span class="mspace"&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="base"&gt;&lt;span class="strut"&gt;&lt;/span&gt;&lt;span class="mord"&gt;&lt;span class="mord mathnormal"&gt;φ&lt;/span&gt;&lt;span class="msupsub"&gt;&lt;span class="vlist-t"&gt;&lt;span class="vlist-r"&gt;&lt;span class="vlist"&gt;&lt;span&gt;&lt;span class="pstrut"&gt;&lt;/span&gt;&lt;span class="sizing reset-size6 size3 mtight"&gt;&lt;span class="mord mtight"&gt;2&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;/div&gt;
&lt;/li&gt;
&lt;li&gt;the hole at the centre is a regular decagon&lt;/li&gt;
&lt;/ul&gt;
&lt;h2&gt;
  
  
  There are only two ways to connect
&lt;/h2&gt;



&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fw8bgesr3ml33jptbmdc4.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fw8bgesr3ml33jptbmdc4.png" alt="The two possible ways two rings can be joined without overlap" width="800" height="563"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;I had every arrangement of two rings enumerated, with overlap forbidden. The result was clean.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;There are exactly two ways two rings can be placed without overlapping.&lt;/strong&gt;&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Pattern&lt;/th&gt;
&lt;th&gt;Pentagons shared&lt;/th&gt;
&lt;th&gt;Ring centre distance&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Adjacent sharing&lt;/td&gt;
&lt;td&gt;two consecutive&lt;/td&gt;
&lt;td&gt;4.98&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Skip sharing&lt;/td&gt;
&lt;td&gt;two with one skipped between&lt;/td&gt;
&lt;td&gt;3.078&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;At any other distance or angle, some pentagon always overlaps another. Arrangements touching at a single point do exist, but they open the structure up too far to be a structure.&lt;/p&gt;

&lt;p&gt;That there are only these two was something I had already established by hand. The AI's exhaustive enumeration only confirmed it by machine. The attribution is stated here explicitly.&lt;/p&gt;
&lt;h2&gt;
  
  
  Do not put a ring at the centre
&lt;/h2&gt;



&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Flm0i2r7qhcy55te5ivg2.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Flm0i2r7qhcy55te5ivg2.png" alt=" " width="799" height="409"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;There was a second error on the AI's side: &lt;strong&gt;it had been putting a ring at the centre.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;One ring in the middle, five more around it at 72° intervals. Brute-forcing every distance and every rotation gives &lt;strong&gt;zero&lt;/strong&gt; valid arrangements. It is geometrically impossible.&lt;/p&gt;

&lt;p&gt;The core is not a ring. The core is a pentagram. The moment the central ring was removed, the five rings fell into place. The original description — &lt;em&gt;arrange the rings around a pentagram&lt;/em&gt; — had been correct as written. (Fig. 4, right.)&lt;/p&gt;

&lt;p&gt;And a second figure appears alongside it: the tightly packed version (Fig. 4, left).&lt;/p&gt;
&lt;h2&gt;
  
  
  The first layer comes in two kinds
&lt;/h2&gt;

&lt;p&gt;The first layer, made of five rings, can be built two ways.&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Arrangement&lt;/th&gt;
&lt;th&gt;Ring centre distance&lt;/th&gt;
&lt;th&gt;Pentagons&lt;/th&gt;
&lt;th&gt;Shared&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;A&lt;/td&gt;
&lt;td&gt;
&lt;div class="katex-element"&gt;
  &lt;span class="katex-display"&gt;&lt;span class="katex"&gt;&lt;span class="katex-mathml"&gt;&lt;/span&gt;&lt;span class="katex-html"&gt;&lt;span class="base"&gt;&lt;span class="strut"&gt;&lt;/span&gt;&lt;span class="mord"&gt;&lt;span class="mord mathnormal"&gt;φ&lt;/span&gt;&lt;span class="msupsub"&gt;&lt;span class="vlist-t"&gt;&lt;span class="vlist-r"&gt;&lt;span class="vlist"&gt;&lt;span&gt;&lt;span class="pstrut"&gt;&lt;/span&gt;&lt;span class="sizing reset-size6 size3 mtight"&gt;&lt;span class="mord mtight"&gt;2&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;/div&gt;
&lt;/td&gt;
&lt;td&gt;36&lt;/td&gt;
&lt;td&gt;14&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;B&lt;/td&gt;
&lt;td&gt;
&lt;div class="katex-element"&gt;
  &lt;span class="katex-display"&gt;&lt;span class="katex"&gt;&lt;span class="katex-mathml"&gt;&lt;/span&gt;&lt;span class="katex-html"&gt;&lt;span class="base"&gt;&lt;span class="strut"&gt;&lt;/span&gt;&lt;span class="mord"&gt;&lt;span class="mord mathnormal"&gt;φ&lt;/span&gt;&lt;span class="msupsub"&gt;&lt;span class="vlist-t"&gt;&lt;span class="vlist-r"&gt;&lt;span class="vlist"&gt;&lt;span&gt;&lt;span class="pstrut"&gt;&lt;/span&gt;&lt;span class="sizing reset-size6 size3 mtight"&gt;&lt;span class="mord mtight"&gt;3&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;/div&gt;
&lt;/td&gt;
&lt;td&gt;40&lt;/td&gt;
&lt;td&gt;10&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;Both have zero overlap and five-fold rotational symmetry. Both are correct.&lt;/p&gt;

&lt;p&gt;Each additional layer needs five more rings: 5, 10, 15. The second layer's ten rings trace a pentagon whose vertices point the opposite way from the first layer's, offset by 36°. That is where &lt;strong&gt;both&lt;/strong&gt; adjacent sharing and skip sharing become necessary. Once the meaning of those two patterns can be read, the second layer and everything after it should follow on its own.&lt;/p&gt;
&lt;h2&gt;
  
  
  Writing it with integers only
&lt;/h2&gt;

&lt;p&gt;The drawing code is written in integer arithmetic alone. Floating point appears in exactly one place: handing coordinates to the SVG at the very end.&lt;/p&gt;

&lt;p&gt;Coordinates are held as elements of Z[ζ], with ζ = e^{iπ/5} (36°), whose minimal polynomial is&lt;/p&gt;


&lt;div class="katex-element"&gt;
  &lt;span class="katex-display"&gt;&lt;span class="katex"&gt;&lt;span class="katex-mathml"&gt;&lt;/span&gt;&lt;span class="katex-html"&gt;&lt;span class="base"&gt;&lt;span class="strut"&gt;&lt;/span&gt;&lt;span class="mord"&gt;&lt;span class="mord mathnormal"&gt;ζ&lt;/span&gt;&lt;span class="msupsub"&gt;&lt;span class="vlist-t"&gt;&lt;span class="vlist-r"&gt;&lt;span class="vlist"&gt;&lt;span&gt;&lt;span class="pstrut"&gt;&lt;/span&gt;&lt;span class="sizing reset-size6 size3 mtight"&gt;&lt;span class="mord mtight"&gt;4&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="mspace"&gt;&lt;/span&gt;&lt;span class="mbin"&gt;−&lt;/span&gt;&lt;span class="mspace"&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="base"&gt;&lt;span class="strut"&gt;&lt;/span&gt;&lt;span class="mord"&gt;&lt;span class="mord mathnormal"&gt;ζ&lt;/span&gt;&lt;span class="msupsub"&gt;&lt;span class="vlist-t"&gt;&lt;span class="vlist-r"&gt;&lt;span class="vlist"&gt;&lt;span&gt;&lt;span class="pstrut"&gt;&lt;/span&gt;&lt;span class="sizing reset-size6 size3 mtight"&gt;&lt;span class="mord mtight"&gt;3&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="mspace"&gt;&lt;/span&gt;&lt;span class="mbin"&gt;+&lt;/span&gt;&lt;span class="mspace"&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="base"&gt;&lt;span class="strut"&gt;&lt;/span&gt;&lt;span class="mord"&gt;&lt;span class="mord mathnormal"&gt;ζ&lt;/span&gt;&lt;span class="msupsub"&gt;&lt;span class="vlist-t"&gt;&lt;span class="vlist-r"&gt;&lt;span class="vlist"&gt;&lt;span&gt;&lt;span class="pstrut"&gt;&lt;/span&gt;&lt;span class="sizing reset-size6 size3 mtight"&gt;&lt;span class="mord mtight"&gt;2&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="mspace"&gt;&lt;/span&gt;&lt;span class="mbin"&gt;−&lt;/span&gt;&lt;span class="mspace"&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="base"&gt;&lt;span class="strut"&gt;&lt;/span&gt;&lt;span class="mord mathnormal"&gt;ζ&lt;/span&gt;&lt;span class="mspace"&gt;&lt;/span&gt;&lt;span class="mbin"&gt;+&lt;/span&gt;&lt;span class="mspace"&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="base"&gt;&lt;span class="strut"&gt;&lt;/span&gt;&lt;span class="mord"&gt;1&lt;/span&gt;&lt;span class="mspace"&gt;&lt;/span&gt;&lt;span class="mrel"&gt;=&lt;/span&gt;&lt;span class="mspace"&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="base"&gt;&lt;span class="strut"&gt;&lt;/span&gt;&lt;span class="mord"&gt;0&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;/div&gt;


&lt;p&gt;An element is an integer 4-tuple:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;u = [a0, a1, a2, a3]  =  a0 + a1·ζ + a2·ζ² + a3·ζ³
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Multiplying by ζ, once reduced with ζ⁴ = ζ³ − ζ² + ζ − 1, is nothing but a permutation of integers with additions and subtractions:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;z_mul_zeta&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;u&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt;
    &lt;span class="n"&gt;a0&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;a1&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;a2&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;a3&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;u&lt;/span&gt;
    &lt;span class="nf"&gt;return &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="n"&gt;a3&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;a0&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="n"&gt;a3&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;a1&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="n"&gt;a3&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;a2&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="n"&gt;a3&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;φ lives inside this ring as an integer:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;φ  = ζ + ζ⁻¹ = 1 + ζ² − ζ³   →  [1, 0, 1, −1]
φ² = φ + 1                    →  [2, 0, 1, −1]
φ³ = φ² + φ                   →  [3, 0, 2, −2]
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Rewritten in balanced base-φ (digits −1, 0, 1), φ² is &lt;code&gt;100&lt;/code&gt; and φ³ is &lt;code&gt;1000&lt;/code&gt;. The two kinds of first layer differ by exactly one digit position in the ring centre distance.&lt;/p&gt;

&lt;p&gt;The generating rules fit in four lines:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;ring radius            R = φ²
k-th ring of layer 1   centre = D·ζ^(2k),  rotation = 2k
its j-th pentagon      centre = D·ζ^(2k) + R·ζ^(2k+j),  orientation = 2k+j
i-th vertex            = centre + ζ^(orientation + 2i)
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Shared pentagons are identified by exact equality of integer coordinates. No tolerance argument enters anywhere. Orientation is compared mod 2, since a pentagon is invariant under 72° — that is, under two address steps.&lt;/p&gt;

&lt;p&gt;Verification: the centre-to-centre distance between neighbouring pentagons within a ring was exactly φ at all ten positions, and the maximum overlap between any two pentagons was exactly 0.&lt;/p&gt;

&lt;h2&gt;
  
  
  Attribution
&lt;/h2&gt;

&lt;p&gt;Separating out where each claim came from.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Stated by the author&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;the unit itself — ten pentagons in a ring&lt;/li&gt;
&lt;li&gt;that there are only two ways to connect: adjacent sharing and skip sharing&lt;/li&gt;
&lt;li&gt;that single-point contact exists but opens the structure too far&lt;/li&gt;
&lt;li&gt;that each layer adds five rings, and that the second layer is offset 36° with its vertices reversed&lt;/li&gt;
&lt;li&gt;the ruling that both kinds of first layer are correct&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Computed by the AI&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;deriving the ring radius φ² and the edge-sharing distance φ&lt;/li&gt;
&lt;li&gt;mechanical confirmation of "only two" by exhaustive enumeration with overlap forbidden&lt;/li&gt;
&lt;li&gt;confirming that zero arrangements exist with a ring at the centre&lt;/li&gt;
&lt;li&gt;the drawing code using the integer representation in Z[ζ]&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Nothing here originated on the AI side. It brought in a wrong definition of the ring, put a ring at the centre, and offered pentagon packings that have been known since Dürer — and was sent back each time. This article is the record of a machine catching up to a structure that had already been settled by hand, and putting it into coordinates.&lt;/p&gt;

&lt;h2&gt;
  
  
  What comes next
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fv82q4lynrk5ihryo4rou.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fv82q4lynrk5ihryo4rou.png" alt="A second Penrose figure" width="800" height="800"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;A different Penrose figure. It will turn up again later.&lt;/p&gt;

&lt;p&gt;The question I am working on is whether Penrose tiles can be made into a processor that computes by structure.&lt;/p&gt;

</description>
      <category>geometry</category>
      <category>python</category>
      <category>showdev</category>
      <category>claude</category>
    </item>
    <item>
      <title>Fibonacci Memory Manager for Notion — Nature Forgets by Addition</title>
      <dc:creator>MORC</dc:creator>
      <pubDate>Fri, 06 Mar 2026 07:40:06 +0000</pubDate>
      <link>https://dev.to/morc_b13/fibonacci-memory-manager-for-notion-nature-forgets-by-addition-4h78</link>
      <guid>https://dev.to/morc_b13/fibonacci-memory-manager-for-notion-nature-forgets-by-addition-4h78</guid>
      <description>&lt;h2&gt;
  
  
  What I Built
&lt;/h2&gt;

&lt;p&gt;A biologically-inspired memory management tool for Notion that uses the &lt;strong&gt;Fibonacci sequence&lt;/strong&gt; to automatically compress and organize your pages — just like human memory during sleep.&lt;/p&gt;

&lt;p&gt;Instead of deleting old notes, the system &lt;strong&gt;bundles them into hierarchical layers&lt;/strong&gt;, preserving importance while reducing detail. The deeper the layer, the older and coarser the memory.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;GitHub:&lt;/strong&gt; &lt;a href="https://github.com/morcb13-bit/fibonacci-notion-memory" rel="noopener noreferrer"&gt;https://github.com/morcb13-bit/fibonacci-notion-memory&lt;/a&gt;&lt;/p&gt;




&lt;h2&gt;
  
  
  The Idea: Nature Forgets by Addition
&lt;/h2&gt;

&lt;p&gt;Human memory doesn't delete — it compresses. During sleep, the brain reorganizes experiences, pushing less relevant details into deeper layers while keeping recent, important memories sharp.&lt;/p&gt;

&lt;p&gt;I wrote a paper exploring this principle:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;em&gt;"Nature Forgets by Addition: A Fibonacci-Based Model for Hierarchical Memory Compression and Weighted Fractal Forgetting"&lt;/em&gt;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;The core insight: &lt;strong&gt;the Fibonacci sequence (1, 1, 2, 3, 5, 8, 13...)&lt;/strong&gt; defines natural growth through addition alone. We can use the same principle for memory compression.&lt;/p&gt;




&lt;h2&gt;
  
  
  How It Works
&lt;/h2&gt;

&lt;h3&gt;
  
  
  Fibonacci Layers
&lt;/h3&gt;

&lt;p&gt;Each layer has a capacity from the Fibonacci sequence:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Layer 0: capacity 1  ← newest, most detailed
Layer 1: capacity 1
Layer 2: capacity 2
Layer 3: capacity 3
Layer 4: capacity 5  ← oldest, most compressed
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;When a layer overflows, items are &lt;strong&gt;bundled&lt;/strong&gt; and pushed to the next layer — cascading automatically.&lt;/p&gt;

&lt;h3&gt;
  
  
  Weighted Fractal Extension
&lt;/h3&gt;

&lt;p&gt;Each Notion page receives a &lt;strong&gt;Fibonacci weight&lt;/strong&gt; automatically:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Newest page  → weight 377
2nd newest   → weight 233
3rd newest   → weight 144
...
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This means recent, important pages &lt;strong&gt;stay prominent&lt;/strong&gt; even after compression.&lt;/p&gt;

&lt;h3&gt;
  
  
  Notion MCP Integration
&lt;/h3&gt;

&lt;p&gt;The tool connects directly to your Notion workspace via the &lt;strong&gt;Notion API&lt;/strong&gt;, reads your pages, runs the Fibonacci compression algorithm, and writes a structured &lt;strong&gt;Memory Report&lt;/strong&gt; back to Notion automatically.&lt;/p&gt;




&lt;h2&gt;
  
  
  Demo
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;============================================================
🧠 Fibonacci Memory Manager for Notion
============================================================

📡 Fetching pages from Notion...
   12 pages retrieved

⚙️  Running Fibonacci Forgetting...

📊 Layer State:
   layer_0: [░] 0/1 (cap=1)
   layer_1: [░] 0/1 (cap=1)
   layer_2: [░░] 0/2 (cap=2)
   layer_3: [█░░] 1/3 (cap=3)
   layer_4: [░░░░░] 0/5 (cap=5)

⭐ Top 5 Most Important:
   [377] Weekly Review 2025-03
   [233] Project Requirements
   [144] Ideas &amp;amp; Notes
   [ 89] Reading Log
   [ 55] Backlog

📝 Creating report in Notion...
✅ Done! Report created in your Notion workspace.
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The report is automatically written back to Notion:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;## Summary
Pages retrieved: 12
Algorithm: Fibonacci Forgetting (Weighted Fractal Extension)

## Layer State
- layer_0: 0/1 (capacity=1)
- layer_1: 0/1 (capacity=1)
- layer_2: 0/2 (capacity=2)
- layer_3: 1/3 (capacity=3)

## Top 10 by Importance (Fibonacci weights)
- [377] Weekly Review 2025-03
- [233] Project Requirements
...

## Reference Paper
Nature Forgets by Addition
by moroc.b13 (2024)
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h2&gt;
  
  
  Setup
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;git clone https://github.com/morcb13-bit/fibonacci-notion-memory
&lt;span class="nb"&gt;cd &lt;/span&gt;fibonacci-notion-memory
pip &lt;span class="nb"&gt;install&lt;/span&gt; &lt;span class="nt"&gt;-r&lt;/span&gt; requirements.txt
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Create a &lt;code&gt;.env&lt;/code&gt; file:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;NOTION_TOKEN=ntn_your_token_here
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Run:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;python fibonacci_memory.py &amp;lt;your_notion_page_id&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h2&gt;
  
  
  Why This Matters
&lt;/h2&gt;

&lt;p&gt;Most productivity tools fight information overload with &lt;strong&gt;deletion&lt;/strong&gt; — archive, trash, purge.&lt;/p&gt;

&lt;p&gt;But biological systems don't delete. They &lt;strong&gt;compress with purpose&lt;/strong&gt;, keeping what matters and abstracting what doesn't.&lt;/p&gt;

&lt;p&gt;Fibonacci Forgetting brings this principle to your Notion workspace:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;No manual archiving&lt;/li&gt;
&lt;li&gt;Importance is preserved automatically&lt;/li&gt;
&lt;li&gt;The system self-organizes like a fractal&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;This is what "human-in-the-loop" AI workflows should feel like — intelligent compression that works &lt;em&gt;with&lt;/em&gt; you, not against you.&lt;/p&gt;




&lt;h2&gt;
  
  
  The Paper
&lt;/h2&gt;

&lt;p&gt;Full paper on dev.to: &lt;a href="https://dev.to/"&gt;Nature Forgets by Addition&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;GitHub: &lt;a href="https://github.com/morcb13-bit/fibonacci-notion-memory" rel="noopener noreferrer"&gt;https://github.com/morcb13-bit/fibonacci-notion-memory&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Built for the &lt;strong&gt;Notion MCP Challenge 2025&lt;/strong&gt; 🏆&lt;/p&gt;

</description>
      <category>notionchallenge</category>
      <category>devchallenge</category>
      <category>mcp</category>
      <category>ai</category>
    </item>
    <item>
      <title>Nature Forgets by Addition</title>
      <dc:creator>MORC</dc:creator>
      <pubDate>Fri, 06 Mar 2026 04:01:52 +0000</pubDate>
      <link>https://dev.to/morc_b13/nature-forgets-by-addition-380c</link>
      <guid>https://dev.to/morc_b13/nature-forgets-by-addition-380c</guid>
      <description>&lt;p&gt;&lt;strong&gt;Nature Forgets by Addition: A Fibonacci-Based Model for Hierarchical Memory Compression and Weighted Fractal Forgetting&lt;/strong&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  &lt;strong&gt;Abstract&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;Digital information—logs, emails, conversation histories, and version control records—accumulates without limit. Conventional systems rely on deletion, but biological memory suggests a different principle: information is not erased but gradually compressed and relegated to deeper layers. This paper introduces &lt;strong&gt;Fibonacci Forgetting&lt;/strong&gt;, a memory model inspired by natural growth patterns and human forgetting. The model uses Fibonacci capacities to trigger overflow-driven bundling and downward abstraction using only addition. We present a minimal implementation, discuss applications, and extend the model into a &lt;strong&gt;weighted fractal architecture&lt;/strong&gt; suitable for Git history management, where newer items naturally carry greater importance. The extended model demonstrates how forgetting can be implemented as a natural, self-similar, and importance-preserving process.&lt;/p&gt;




&lt;h2&gt;
  
  
  &lt;strong&gt;1. Introduction&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;Human memory reorganizes itself during sleep, assigning weights to experiences and pushing less relevant details into deeper layers. This stands in contrast to digital systems, which typically rely on deletion or fixed-size caches. This paper proposes a biologically inspired alternative: &lt;strong&gt;memory compression through addition&lt;/strong&gt;, grounded in the Fibonacci sequence—a universal structure underlying natural growth, fractals, and efficient packing.&lt;/p&gt;




&lt;h2&gt;
  
  
  &lt;strong&gt;2. Natural Foundations: The Fibonacci Mechanism&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;The Fibonacci recurrence&lt;/p&gt;

&lt;p&gt;F(n+1) = F(n) + F(n-1)&lt;/p&gt;

&lt;p&gt;produces structures found throughout nature, including phyllotaxis, spirals, and neural patterns. Because biological systems grow by incremental addition, the Fibonacci sequence emerges as a fundamental organizing principle. We extend this principle to forgetting: &lt;strong&gt;compression through additive bundling&lt;/strong&gt;, not erasure.&lt;/p&gt;




&lt;h2&gt;
  
  
  &lt;strong&gt;3. The Fibonacci Forgetting Model&lt;/strong&gt;
&lt;/h2&gt;

&lt;h3&gt;
  
  
  &lt;strong&gt;3.1 Layered Architecture&lt;/strong&gt;
&lt;/h3&gt;

&lt;p&gt;Information is stored in hierarchical layers:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Layer 0 — individual items
&lt;/li&gt;
&lt;li&gt;Layer 1 — small bundles
&lt;/li&gt;
&lt;li&gt;Layer 2 — larger bundles
&lt;/li&gt;
&lt;li&gt;Layer 3+ — conceptual aggregates
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Each layer has a capacity defined by the Fibonacci sequence:&lt;/p&gt;

&lt;p&gt;1, 1, 2, 3, 5, 8, 13,&lt;/p&gt;

&lt;h3&gt;
  
  
  &lt;strong&gt;3.2 Forgetting by Addition&lt;/strong&gt;
&lt;/h3&gt;

&lt;p&gt;When a layer exceeds its capacity:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Items are bundled by addition (e.g., counted).
&lt;/li&gt;
&lt;li&gt;The bundle is pushed to the next layer.
&lt;/li&gt;
&lt;li&gt;Cascading continues if the lower layer also overflows.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;This yields:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;upper layers — fine-grained, recent
&lt;/li&gt;
&lt;li&gt;lower layers — coarse, older
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;We call this mechanism &lt;strong&gt;Fibonacci Forgetting&lt;/strong&gt;.&lt;/p&gt;




&lt;h2&gt;
  
  
  &lt;strong&gt;4. Minimal Implementation&lt;/strong&gt;
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="kn"&gt;from&lt;/span&gt; &lt;span class="n"&gt;dataclasses&lt;/span&gt; &lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="n"&gt;dataclass&lt;/span&gt;

&lt;span class="n"&gt;FIB&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;3&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;5&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;8&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;13&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;21&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;

&lt;span class="nd"&gt;@dataclass&lt;/span&gt;
&lt;span class="k"&gt;class&lt;/span&gt; &lt;span class="nc"&gt;FibonacciForgettingMemory&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
    &lt;span class="n"&gt;layers&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nb"&gt;list&lt;/span&gt;

    &lt;span class="nd"&gt;@classmethod&lt;/span&gt;
    &lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;new&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;cls&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;depth&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="mi"&gt;6&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt;
        &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="nf"&gt;cls&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;layers&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="p"&gt;[[]&lt;/span&gt; &lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="n"&gt;_&lt;/span&gt; &lt;span class="ow"&gt;in&lt;/span&gt; &lt;span class="nf"&gt;range&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;depth&lt;/span&gt;&lt;span class="p"&gt;)])&lt;/span&gt;

    &lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;add&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;self&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;item&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt;
        &lt;span class="n"&gt;self&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;layers&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;].&lt;/span&gt;&lt;span class="nf"&gt;append&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;item&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
        &lt;span class="n"&gt;self&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;_cascade&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;

    &lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;_cascade&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;self&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;level&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt;
        &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="n"&gt;level&lt;/span&gt; &lt;span class="o"&gt;&amp;gt;=&lt;/span&gt; &lt;span class="nf"&gt;len&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;self&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;layers&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
            &lt;span class="k"&gt;return&lt;/span&gt;

        &lt;span class="n"&gt;limit&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;FIB&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;level&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;

        &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="nf"&gt;len&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;self&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;layers&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;level&lt;/span&gt;&lt;span class="p"&gt;])&lt;/span&gt; &lt;span class="o"&gt;&amp;gt;&lt;/span&gt; &lt;span class="n"&gt;limit&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
            &lt;span class="n"&gt;bundle&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;len&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;self&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;layers&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;level&lt;/span&gt;&lt;span class="p"&gt;])&lt;/span&gt;
            &lt;span class="n"&gt;self&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;layers&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;level&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;[]&lt;/span&gt;
            &lt;span class="n"&gt;self&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;layers&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;level&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;].&lt;/span&gt;&lt;span class="nf"&gt;append&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;bundle&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
            &lt;span class="n"&gt;self&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;_cascade&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;level&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;

    &lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;state&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;self&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt;
        &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="n"&gt;self&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;layers&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h2&gt;
  
  
  &lt;strong&gt;5. Applications&lt;/strong&gt;
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;email management
&lt;/li&gt;
&lt;li&gt;log compression
&lt;/li&gt;
&lt;li&gt;cache systems
&lt;/li&gt;
&lt;li&gt;LLM long-term memory
&lt;/li&gt;
&lt;li&gt;Git history management
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The entire mechanism uses &lt;strong&gt;addition only&lt;/strong&gt;, making it simple and robust.&lt;/p&gt;




&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fiayld47pnotqompgynmb.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fiayld47pnotqompgynmb.jpg" alt=" " width="800" height="738"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h1&gt;
  
  
  &lt;strong&gt;6. Weighted Fractal Fibonacci Memory (Full Integration of the “Bonus” Section)&lt;/strong&gt;
&lt;/h1&gt;

&lt;h2&gt;
  
  
  &lt;strong&gt;6.1 Overview&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;To make Fibonacci Forgetting practical for Git, we introduce a &lt;strong&gt;weighted fractal extension&lt;/strong&gt;.&lt;br&gt;&lt;br&gt;
This model assigns Fibonacci-based weights to items (e.g., commits), bundles them while preserving total weight, and forms a self-similar fractal hierarchy.&lt;/p&gt;




&lt;h2&gt;
  
  
  *&lt;em&gt;6.2 Specification *&lt;/em&gt;
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Each item (e.g., a commit) is assigned a &lt;strong&gt;weight&lt;/strong&gt;.
&lt;/li&gt;
&lt;li&gt;Weights are automatically selected from the &lt;strong&gt;Fibonacci sequence&lt;/strong&gt;, with newer items receiving larger Fibonacci values.
&lt;/li&gt;
&lt;li&gt;During bundling (cascade), the &lt;strong&gt;sum of weights&lt;/strong&gt; is preserved and treated as the “overall importance” of the bundle.
&lt;/li&gt;
&lt;li&gt;Upper layers contain heavier, fine-grained items; lower layers contain coarser, lighter bundles.
&lt;/li&gt;
&lt;li&gt;This produces a natural hierarchy where recent changes remain prominent.&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  &lt;strong&gt;6.3 Full Code&lt;/strong&gt;
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="kn"&gt;from&lt;/span&gt; &lt;span class="n"&gt;typing&lt;/span&gt; &lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="n"&gt;Any&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;List&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;Dict&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;Optional&lt;/span&gt;

&lt;span class="k"&gt;class&lt;/span&gt; &lt;span class="nc"&gt;FractalFibMemoryWithFibWeights&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
    &lt;span class="sh"&gt;"""&lt;/span&gt;&lt;span class="s"&gt;
    Fractal Fibonacci Forgetting with Fibonacci-based weights.
    - Newer items receive larger Fibonacci weights.
    - During bundling, the total weight is preserved and propagated downward.
    - Ideal for Git commit management: recent changes remain heavy, older ones become coarse.
    &lt;/span&gt;&lt;span class="sh"&gt;"""&lt;/span&gt;

    &lt;span class="c1"&gt;# Fibonacci weights (reversed so larger weights are assigned first)
&lt;/span&gt;    &lt;span class="n"&gt;FIB_WEIGHTS&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;3&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;5&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;8&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;13&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;21&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;34&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;55&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;89&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;144&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;233&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;377&lt;/span&gt;&lt;span class="p"&gt;][::&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;

    &lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;__init__&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;self&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;level&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nb"&gt;int&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;max_depth&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nb"&gt;int&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;10&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt;
        &lt;span class="n"&gt;self&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;level&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;level&lt;/span&gt;
        &lt;span class="n"&gt;self&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;max_depth&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;max_depth&lt;/span&gt;
        &lt;span class="n"&gt;self&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;items&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;List&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;Dict&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;[]&lt;/span&gt;  &lt;span class="c1"&gt;# {'content': Any, 'weight': int}
&lt;/span&gt;        &lt;span class="n"&gt;self&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;children&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;List&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="s"&gt;FractalFibMemoryWithFibWeights&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;[]&lt;/span&gt;
        &lt;span class="n"&gt;self&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;bundle_weight&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;Optional&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="nb"&gt;int&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="bp"&gt;None&lt;/span&gt;

        &lt;span class="c1"&gt;# Layer capacity defined by Fibonacci sequence
&lt;/span&gt;        &lt;span class="n"&gt;fib_caps&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;3&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;5&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;8&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;13&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;21&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;34&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;55&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;
        &lt;span class="n"&gt;self&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;capacity&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;fib_caps&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="nf"&gt;min&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;level&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nf"&gt;len&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;fib_caps&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;)]&lt;/span&gt;

    &lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;add&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;self&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;content&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;Any&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt;
        &lt;span class="sh"&gt;"""&lt;/span&gt;&lt;span class="s"&gt;Add a new item with an automatically assigned Fibonacci weight.&lt;/span&gt;&lt;span class="sh"&gt;"""&lt;/span&gt;
        &lt;span class="n"&gt;weight_index&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;min&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nf"&gt;len&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;self&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;items&lt;/span&gt;&lt;span class="p"&gt;),&lt;/span&gt; &lt;span class="nf"&gt;len&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;self&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;FIB_WEIGHTS&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
        &lt;span class="n"&gt;weight&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;self&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;FIB_WEIGHTS&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;weight_index&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;

        &lt;span class="n"&gt;self&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;items&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;append&lt;/span&gt;&lt;span class="p"&gt;({&lt;/span&gt;
            &lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="s"&gt;content&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;content&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
            &lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="s"&gt;weight&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;weight&lt;/span&gt;
        &lt;span class="p"&gt;})&lt;/span&gt;

        &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="nf"&gt;len&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;self&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;items&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;&amp;gt;&lt;/span&gt; &lt;span class="n"&gt;self&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;capacity&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
            &lt;span class="n"&gt;self&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;_cascade&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;

    &lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;_cascade&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;self&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt;
        &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="ow"&gt;not&lt;/span&gt; &lt;span class="n"&gt;self&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;items&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
            &lt;span class="k"&gt;return&lt;/span&gt;

        &lt;span class="c1"&gt;# Compute total weight of the bundle
&lt;/span&gt;        &lt;span class="n"&gt;total_weight&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;sum&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;item&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="s"&gt;weight&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="n"&gt;item&lt;/span&gt; &lt;span class="ow"&gt;in&lt;/span&gt; &lt;span class="n"&gt;self&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;items&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;

        &lt;span class="n"&gt;bundle&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
            &lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="s"&gt;level&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;self&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;level&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
            &lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="s"&gt;count&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nf"&gt;len&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;self&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;items&lt;/span&gt;&lt;span class="p"&gt;),&lt;/span&gt;
            &lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="s"&gt;items&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;self&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;items&lt;/span&gt;&lt;span class="p"&gt;[:],&lt;/span&gt;
            &lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="s"&gt;total_weight&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;total_weight&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
            &lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="s"&gt;type&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="s"&gt;bundle&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;
        &lt;span class="p"&gt;}&lt;/span&gt;
        &lt;span class="n"&gt;self&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;items&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;clear&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;

        &lt;span class="c1"&gt;# Deep-layer handling
&lt;/span&gt;        &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="n"&gt;self&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;level&lt;/span&gt; &lt;span class="o"&gt;&amp;gt;=&lt;/span&gt; &lt;span class="n"&gt;self&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;max_depth&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
            &lt;span class="n"&gt;self&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;children&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;append&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;bundle&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
            &lt;span class="k"&gt;return&lt;/span&gt;

        &lt;span class="c1"&gt;# Create a child fractal node if needed
&lt;/span&gt;        &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="ow"&gt;not&lt;/span&gt; &lt;span class="n"&gt;self&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;children&lt;/span&gt; &lt;span class="ow"&gt;or&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nf"&gt;isinstance&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;self&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;children&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;],&lt;/span&gt; &lt;span class="nb"&gt;dict&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="ow"&gt;or&lt;/span&gt; &lt;span class="nf"&gt;len&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;self&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;children&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;].&lt;/span&gt;&lt;span class="n"&gt;items&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;&amp;gt;&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt;
            &lt;span class="n"&gt;child&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nc"&gt;FractalFibMemoryWithFibWeights&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;self&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;level&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;self&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;max_depth&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
            &lt;span class="n"&gt;self&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;children&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;append&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;child&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;

        &lt;span class="c1"&gt;# Pass the bundle downward
&lt;/span&gt;        &lt;span class="n"&gt;self&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;children&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;].&lt;/span&gt;&lt;span class="nf"&gt;add&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;bundle&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;

    &lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;state&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;self&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;depth&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nb"&gt;int&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;-&amp;gt;&lt;/span&gt; &lt;span class="nb"&gt;str&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
        &lt;span class="sh"&gt;"""&lt;/span&gt;&lt;span class="s"&gt;Visualize the fractal structure with weights.&lt;/span&gt;&lt;span class="sh"&gt;"""&lt;/span&gt;
        &lt;span class="n"&gt;indent&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;  &lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="n"&gt;depth&lt;/span&gt;
        &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="nf"&gt;hasattr&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;self&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="s"&gt;bundle_weight&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="ow"&gt;and&lt;/span&gt; &lt;span class="n"&gt;self&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;bundle_weight&lt;/span&gt; &lt;span class="ow"&gt;is&lt;/span&gt; &lt;span class="ow"&gt;not&lt;/span&gt; &lt;span class="bp"&gt;None&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
            &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="sa"&gt;f&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="si"&gt;{&lt;/span&gt;&lt;span class="n"&gt;indent&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt;&lt;span class="s"&gt;Bundle @ Level &lt;/span&gt;&lt;span class="si"&gt;{&lt;/span&gt;&lt;span class="n"&gt;self&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;level&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt;&lt;span class="s"&gt; (total_weight=&lt;/span&gt;&lt;span class="si"&gt;{&lt;/span&gt;&lt;span class="n"&gt;self&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;bundle_weight&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt;&lt;span class="s"&gt;, count=?)&lt;/span&gt;&lt;span class="se"&gt;\n&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;

        &lt;span class="n"&gt;s&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="sa"&gt;f&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="si"&gt;{&lt;/span&gt;&lt;span class="n"&gt;indent&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt;&lt;span class="s"&gt;Level &lt;/span&gt;&lt;span class="si"&gt;{&lt;/span&gt;&lt;span class="n"&gt;self&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;level&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt;&lt;span class="s"&gt; (cap=&lt;/span&gt;&lt;span class="si"&gt;{&lt;/span&gt;&lt;span class="n"&gt;self&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;capacity&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt;&lt;span class="s"&gt;): &lt;/span&gt;&lt;span class="si"&gt;{&lt;/span&gt;&lt;span class="nf"&gt;len&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;self&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;items&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt;&lt;span class="s"&gt; items&lt;/span&gt;&lt;span class="se"&gt;\n&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;
        &lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="n"&gt;item&lt;/span&gt; &lt;span class="ow"&gt;in&lt;/span&gt; &lt;span class="n"&gt;self&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;items&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
            &lt;span class="n"&gt;s&lt;/span&gt; &lt;span class="o"&gt;+=&lt;/span&gt; &lt;span class="sa"&gt;f&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="si"&gt;{&lt;/span&gt;&lt;span class="n"&gt;indent&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt;&lt;span class="s"&gt;  - &lt;/span&gt;&lt;span class="si"&gt;{&lt;/span&gt;&lt;span class="n"&gt;item&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="s"&gt;content&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt;&lt;span class="s"&gt; (weight=&lt;/span&gt;&lt;span class="si"&gt;{&lt;/span&gt;&lt;span class="n"&gt;item&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="s"&gt;weight&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt;&lt;span class="s"&gt;)&lt;/span&gt;&lt;span class="se"&gt;\n&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;

        &lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="n"&gt;child&lt;/span&gt; &lt;span class="ow"&gt;in&lt;/span&gt; &lt;span class="n"&gt;self&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;children&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
            &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="nf"&gt;isinstance&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;child&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nb"&gt;dict&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt;
                &lt;span class="n"&gt;s&lt;/span&gt; &lt;span class="o"&gt;+=&lt;/span&gt; &lt;span class="sa"&gt;f&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="si"&gt;{&lt;/span&gt;&lt;span class="n"&gt;indent&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt;&lt;span class="s"&gt;  └─ Bundle L&lt;/span&gt;&lt;span class="si"&gt;{&lt;/span&gt;&lt;span class="n"&gt;child&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="s"&gt;level&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt;&lt;span class="s"&gt; (count=&lt;/span&gt;&lt;span class="si"&gt;{&lt;/span&gt;&lt;span class="n"&gt;child&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="s"&gt;count&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt;&lt;span class="s"&gt;, total_weight=&lt;/span&gt;&lt;span class="si"&gt;{&lt;/span&gt;&lt;span class="n"&gt;child&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="s"&gt;total_weight&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt;&lt;span class="s"&gt;)&lt;/span&gt;&lt;span class="se"&gt;\n&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;
            &lt;span class="k"&gt;else&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
                &lt;span class="n"&gt;s&lt;/span&gt; &lt;span class="o"&gt;+=&lt;/span&gt; &lt;span class="n"&gt;child&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;state&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;depth&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
        &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="n"&gt;s&lt;/span&gt;

    &lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;get_weighted_recent&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;self&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;n&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nb"&gt;int&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;10&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;-&amp;gt;&lt;/span&gt; &lt;span class="n"&gt;List&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;Dict&lt;/span&gt;&lt;span class="p"&gt;]:&lt;/span&gt;
        &lt;span class="sh"&gt;"""&lt;/span&gt;&lt;span class="s"&gt;Retrieve the most recent items sorted by weight (importance).&lt;/span&gt;&lt;span class="sh"&gt;"""&lt;/span&gt;
        &lt;span class="n"&gt;collected&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;[]&lt;/span&gt;

        &lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;collect&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;node&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt;
            &lt;span class="n"&gt;collected&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;extend&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;node&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;items&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
            &lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="n"&gt;c&lt;/span&gt; &lt;span class="ow"&gt;in&lt;/span&gt; &lt;span class="n"&gt;node&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;children&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
                &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="nf"&gt;isinstance&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;c&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nb"&gt;dict&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt;
                    &lt;span class="n"&gt;collected&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;append&lt;/span&gt;&lt;span class="p"&gt;({&lt;/span&gt;
                        &lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="s"&gt;content&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="sa"&gt;f&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;[Bundle &lt;/span&gt;&lt;span class="si"&gt;{&lt;/span&gt;&lt;span class="n"&gt;c&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="s"&gt;count&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt;&lt;span class="s"&gt; items]&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
                        &lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="s"&gt;weight&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;c&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="s"&gt;total_weight&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;
                    &lt;span class="p"&gt;})&lt;/span&gt;
                &lt;span class="k"&gt;else&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
                    &lt;span class="nf"&gt;collect&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;c&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;

        &lt;span class="nf"&gt;collect&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;self&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
        &lt;span class="n"&gt;collected&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;sort&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;key&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="k"&gt;lambda&lt;/span&gt; &lt;span class="n"&gt;x&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;x&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="s"&gt;weight&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="p"&gt;],&lt;/span&gt; &lt;span class="n"&gt;reverse&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="bp"&gt;True&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
        &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="n"&gt;collected&lt;/span&gt;&lt;span class="p"&gt;[:&lt;/span&gt;&lt;span class="n"&gt;n&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;


&lt;span class="c1"&gt;# Demo
&lt;/span&gt;&lt;span class="n"&gt;mem&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nc"&gt;FractalFibMemoryWithFibWeights&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;

&lt;span class="c1"&gt;# Add commits (newer commits receive larger weights)
&lt;/span&gt;&lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="n"&gt;i&lt;/span&gt; &lt;span class="ow"&gt;in&lt;/span&gt; &lt;span class="nf"&gt;range&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;80&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt;
    &lt;span class="n"&gt;msg&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="sa"&gt;f&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;commit_&lt;/span&gt;&lt;span class="si"&gt;{&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="si"&gt;:&lt;/span&gt;&lt;span class="mi"&gt;03&lt;/span&gt;&lt;span class="n"&gt;d&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt;&lt;span class="s"&gt; - &lt;/span&gt;&lt;span class="si"&gt;{&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="s"&gt;fix&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt; &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="n"&gt;i&lt;/span&gt; &lt;span class="o"&gt;%&lt;/span&gt; &lt;span class="mi"&gt;3&lt;/span&gt; &lt;span class="o"&gt;==&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt; &lt;span class="k"&gt;else&lt;/span&gt; &lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="s"&gt;refactor&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt; &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="n"&gt;i&lt;/span&gt; &lt;span class="o"&gt;%&lt;/span&gt; &lt;span class="mi"&gt;5&lt;/span&gt; &lt;span class="o"&gt;==&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt; &lt;span class="k"&gt;else&lt;/span&gt; &lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="s"&gt;feat&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;
    &lt;span class="n"&gt;mem&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;add&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;msg&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;

&lt;span class="nf"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;=== Fractal Structure (Weighted) ===&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="nf"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;mem&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;state&lt;/span&gt;&lt;span class="p"&gt;())&lt;/span&gt;

&lt;span class="nf"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="se"&gt;\n&lt;/span&gt;&lt;span class="s"&gt;=== Top 10 Most Important Recent Items ===&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="n"&gt;recent&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;mem&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;get_weighted_recent&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;10&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="n"&gt;item&lt;/span&gt; &lt;span class="ow"&gt;in&lt;/span&gt; &lt;span class="n"&gt;recent&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
    &lt;span class="nf"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sa"&gt;f&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;- &lt;/span&gt;&lt;span class="si"&gt;{&lt;/span&gt;&lt;span class="n"&gt;item&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="s"&gt;content&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt;&lt;span class="s"&gt; (weight=&lt;/span&gt;&lt;span class="si"&gt;{&lt;/span&gt;&lt;span class="n"&gt;item&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="s"&gt;weight&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt;&lt;span class="s"&gt;)&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h2&gt;
  
  
  &lt;strong&gt;6.4 Summary of Characteristics (Fully Translated)&lt;/strong&gt;
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Weight assignment:&lt;/strong&gt; newer items receive larger Fibonacci values (e.g., 233 → 1).
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Bundle weight propagation:&lt;/strong&gt; total weight is preserved and passed downward, so deep-layer bundles represent “clusters of past important changes.”
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Natural forgetting:&lt;/strong&gt; upper layers store fine-grained items; lower layers store coarse aggregates.
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Practical benefit:&lt;/strong&gt; in Git logs, major recent refactors remain prominent.&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  &lt;strong&gt;7. Discussion&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;Fibonacci Forgetting provides a biologically inspired alternative to deletion-based memory management. The weighted fractal extension shows that forgetting can preserve importance while reducing detail.&lt;/p&gt;




&lt;h2&gt;
  
  
  &lt;strong&gt;8. Conclusion&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;This paper presented Fibonacci Forgetting and its weighted fractal extension, demonstrating how natural principles can guide memory compression in digital systems.&lt;/p&gt;




&lt;h2&gt;
  
  
  &lt;strong&gt;License&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;All code in this paper is released under the MIT License.&lt;br&gt;&lt;br&gt;
Copyright (c) 2024 moroc.b13&lt;/p&gt;




</description>
      <category>algorithms</category>
      <category>architecture</category>
      <category>computerscience</category>
      <category>data</category>
    </item>
    <item>
      <title>φ-NTT: An Exact Integer Transform with a Built-In Wavelet Structure</title>
      <dc:creator>MORC</dc:creator>
      <pubDate>Sat, 28 Feb 2026 18:46:58 +0000</pubDate>
      <link>https://dev.to/morc_b13/ph-ntt-an-exact-integer-transform-with-a-built-in-wavelet-structure-5767</link>
      <guid>https://dev.to/morc_b13/ph-ntt-an-exact-integer-transform-with-a-built-in-wavelet-structure-5767</guid>
      <description>&lt;h1&gt;
  
  
  φ-NTT: An Exact Integer Transform with a Built-In Wavelet Structure
&lt;/h1&gt;

&lt;p&gt;&lt;em&gt;A summary of "φ-NTT: A Carry-Free Transform on Z₁₀^B with Hierarchical Wavelet Structure"&lt;/em&gt;&lt;/p&gt;




&lt;p&gt;The FFT is everywhere — audio, imaging, communications, compression. But it has a silent cost: every computation passes through complex floating-point arithmetic, accumulating rounding errors that are impossible to eliminate entirely.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;φ-NTT&lt;/strong&gt; takes a different path. It is a signal transform where every operation stays in exact integers, from start to finish. No approximations. No rounding. Lossless reconstruction is not a goal — it is a structural guarantee.&lt;/p&gt;




&lt;h2&gt;
  
  
  The Core Idea: Carry-Free Arithmetic
&lt;/h2&gt;

&lt;p&gt;In ordinary arithmetic, digits interact. Add 19 + 1 and you get a carry: the ones digit resets, the tens digit increments. This cross-digit coupling is exactly what makes standard modular convolution hard to diagonalize cleanly at scale.&lt;/p&gt;

&lt;p&gt;φ-NTT lives in a different world. It operates on the &lt;strong&gt;carry-free group Z₁₀^B&lt;/strong&gt; — the B-fold direct product of Z₁₀ — where each decimal digit evolves independently under mod-10 arithmetic:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;carry-free addition:  (n ⊕ m)ᵢ = (dᵢ(n) + dᵢ(m)) mod 10
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;No carry ever crosses a digit boundary. This is not a restriction — it is the structure that makes everything work. Because digits are independent, the transform can be built as a clean &lt;strong&gt;B-stage tensor product&lt;/strong&gt;, with zero inter-stage twiddle factors at any depth.&lt;/p&gt;




&lt;h2&gt;
  
  
  The Coefficient Ring: Z[φ]
&lt;/h2&gt;

&lt;p&gt;All arithmetic runs over &lt;strong&gt;Z[φ] = Z[√5]&lt;/strong&gt;, the golden-ratio integer ring. Elements are integer pairs &lt;code&gt;(a, b)&lt;/code&gt; representing &lt;code&gt;a + b·φ&lt;/code&gt;, where &lt;code&gt;φ = (1+√5)/2&lt;/code&gt;. Multiplication is:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;(a, b) · (c, d) = (ac + bd,  ad + bc + bd)
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Three coefficient values cover the entire C₅-twisted DFT basis: &lt;code&gt;(2,0)&lt;/code&gt;, &lt;code&gt;(-1,1)&lt;/code&gt;, &lt;code&gt;(0,-1)&lt;/code&gt;. No irrational numbers appear at runtime. Every intermediate value is an exact integer pair.&lt;/p&gt;




&lt;h2&gt;
  
  
  A 2^B Channel Filterbank
&lt;/h2&gt;

&lt;p&gt;Transforming a length-10^B signal produces &lt;strong&gt;2^B output channels&lt;/strong&gt;, each labeled by a string of T's and U's of length B (e.g., for B=3: &lt;code&gt;TTT&lt;/code&gt;, &lt;code&gt;TUT&lt;/code&gt;, &lt;code&gt;UUU&lt;/code&gt;, …).&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;T at digit b&lt;/strong&gt; — low-pass projection: extracts the slowly-varying component of the signal across digit position b (C₅-twisted DFT side)&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;U at digit b&lt;/strong&gt; — high-pass projection: extracts the parity alternation &lt;code&gt;(-1)^{d_b}&lt;/code&gt; at digit b (Z₂ side)&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The B-stage tensor product applies these operators independently at each digit, giving a complete decomposition. Exact reconstruction is guaranteed by the inverse transform, with scale factors 40^B (round-trip) or 80^B (after convolution) that divide exactly in Z[φ] — verified by assertion for B = 1..5.&lt;/p&gt;




&lt;h2&gt;
  
  
  It Looks Like a Wavelet Transform
&lt;/h2&gt;

&lt;p&gt;The channel label set &lt;code&gt;{T, U}^B&lt;/code&gt; maps naturally onto the leaves of a complete binary tree of depth B:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;              root
           /        \
        T(d₂)       U(d₂)
       /     \      /     \
    T(d₁)  U(d₁)  T(d₁)  U(d₁)
    / \    / \    / \    / \
   T   U  T   U  T   U  T   U
  (d₀)   (d₀)   (d₀)   (d₀)
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The channel &lt;code&gt;TT…T&lt;/code&gt; (leftmost leaf) captures the coarsest approximation. The channel &lt;code&gt;UU…U&lt;/code&gt; (rightmost) captures the finest detail — the checkerboard pattern across all digits simultaneously.&lt;/p&gt;

&lt;p&gt;This structure is directly analogous to &lt;strong&gt;Haar multiresolution analysis (MRA)&lt;/strong&gt;, with T playing the role of the scaling function and U the wavelet. The differences are significant but structural:&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Property&lt;/th&gt;
&lt;th&gt;Haar MRA&lt;/th&gt;
&lt;th&gt;φ-NTT&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Signal length&lt;/td&gt;
&lt;td&gt;2^B&lt;/td&gt;
&lt;td&gt;10^B&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Channels&lt;/td&gt;
&lt;td&gt;2^B&lt;/td&gt;
&lt;td&gt;2^B&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Approximation&lt;/td&gt;
&lt;td&gt;scaling function&lt;/td&gt;
&lt;td&gt;TT…T channel&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Detail&lt;/td&gt;
&lt;td&gt;wavelet coeff.&lt;/td&gt;
&lt;td&gt;T…TU_bT…T channels&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Arithmetic&lt;/td&gt;
&lt;td&gt;real (±1 basis)&lt;/td&gt;
&lt;td&gt;Z[φ] integer ring&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Orthogonality&lt;/td&gt;
&lt;td&gt;exact&lt;/td&gt;
&lt;td&gt;conjectured (open problem)&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;




&lt;h2&gt;
  
  
  Where Does the Energy Go?
&lt;/h2&gt;

&lt;p&gt;For a low-frequency test signal &lt;code&gt;sin(2πn/100)&lt;/code&gt; (period 100 ≈ 2·10¹), energy concentrates sharply in just a few channels:&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;B&lt;/th&gt;
&lt;th&gt;Top channel&lt;/th&gt;
&lt;th&gt;Energy&lt;/th&gt;
&lt;th&gt;Top-3 combined&lt;/th&gt;
&lt;th&gt;UU…U&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;3&lt;/td&gt;
&lt;td&gt;TUT&lt;/td&gt;
&lt;td&gt;86.4%&lt;/td&gt;
&lt;td&gt;99.8%&lt;/td&gt;
&lt;td&gt;&amp;lt; 0.01%&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;4&lt;/td&gt;
&lt;td&gt;TUTT&lt;/td&gt;
&lt;td&gt;68.7%&lt;/td&gt;
&lt;td&gt;98.1%&lt;/td&gt;
&lt;td&gt;&amp;lt; 0.01%&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;5&lt;/td&gt;
&lt;td&gt;TUTTT&lt;/td&gt;
&lt;td&gt;68.2%&lt;/td&gt;
&lt;td&gt;97.6%&lt;/td&gt;
&lt;td&gt;&amp;lt; 0.01%&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;Why &lt;code&gt;TUT…T&lt;/code&gt;? A period-100 signal is dominated by variation in the tens digit d₁. The U operator at stage b=1 extracts exactly that: the parity alternation &lt;code&gt;(-1)^{d₁}&lt;/code&gt;. Other digit positions vary slowly, so T suffices there. The result is a &lt;strong&gt;digit-frequency correspondence&lt;/strong&gt;: signals with period ≈ 2·10^b concentrate in the channel with U only at position b.&lt;/p&gt;

&lt;p&gt;This is formalized as the &lt;strong&gt;Spectral Concentration Quasi-Theorem&lt;/strong&gt;:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;For a signal with dominant period P ≈ 2·10^b, under digit-wise smoothness assumptions, the energy fraction captured by the level-b detail channel satisfies:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;α_b ≥ C · (1 − ε)^{B−1}&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Empirically: top-3 channels cover ≥ 97% of total energy for B = 3..5.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;The bound decays exponentially in B — not a defect, but a reflection of the fact that more digit stages means more channels competing for energy. The top-3 coverage stays stable because the nearest neighbor channels (at levels b±1) absorb most of the leakage.&lt;/p&gt;




&lt;h2&gt;
  
  
  What the Convolution Theorem Gives You
&lt;/h2&gt;

&lt;p&gt;Just as FFT diagonalizes cyclic convolution on Z/(N), φ-NTT diagonalizes &lt;strong&gt;carry-free convolution&lt;/strong&gt; on Z₁₀^B:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;(x ⋆ h)[n] = Σ_m h[m] · x[cf_sub(n, m)]
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;In the channel domain, this becomes a pointwise product with a simple T/U cross-coupling rule per stage:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;2·Y_T[k] = X_T[k]·H_T[k] − SIN2 · X_U[k]·H_U[k]
2·Y_U[k] = X_T[k]·H_U[k] + X_U[k]·H_T[k]
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;where &lt;code&gt;SIN2 = (3,−1) ∈ Z[φ] ≈ 1.382 = 4sin²(2π/10)&lt;/code&gt;. Verified for B = 1..5 against direct O(N²) computation. Carry-free cross-correlation reduces to convolution with the carry-free-reversed kernel &lt;code&gt;h_rev[m] = h[cf_neg(m)]&lt;/code&gt;.&lt;/p&gt;




&lt;h2&gt;
  
  
  Open Problems
&lt;/h2&gt;

&lt;p&gt;Three things remain unproved or unresolved:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;T/U orthogonality (P1)&lt;/strong&gt; — numerical evidence is clear (energy partitions cleanly, reconstruction is exact), but the algebraic proof of T_b ⊥ U_b over Z[φ] is open. Proving this would upgrade the quasi-theorem to a full theorem.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Closed forms for C and ε (P2)&lt;/strong&gt; — the spectral concentration constants are currently back-derived from observations. Explicit expressions in terms of P, base 10, and Z[φ] basis would make the bound signal-class independent.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Bridging to carry-based convolution (P3)&lt;/strong&gt; — φ-NTT handles carry-free signals natively. Connecting it to ordinary integer sequences via overlap-add requires handling the non-isomorphism Z₁₀^B ≇ Z/(10^B)Z for B ≥ 2.&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;




&lt;h2&gt;
  
  
  How It Compares
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;vs. FFT&lt;/strong&gt; — FFT diagonalizes cyclic convolution on Z/(N) with complex floating-point twiddles. φ-NTT diagonalizes a different algebra (carry-free convolution on Z₁₀^B) with exact integer coefficients. The two are not interchangeable — they solve different problems.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;vs. NTT (Number Theoretic Transform)&lt;/strong&gt; — classical NTT swaps complex roots of unity for modular roots, but keeps the cyclic group Z/(N). φ-NTT uses the direct product group Z₁₀^B and the ring Z&lt;a href="https://dev.tonot%20a%20finite%20field"&gt;φ&lt;/a&gt;, trading the standard group structure for twiddle-free recursion and exact arithmetic.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;vs. Haar wavelets&lt;/strong&gt; — the binary tree structure and T/U split are genuinely analogous to Haar MRA. But Haar lives over ℝ with ±1 basis on Z/(2^B)Z; φ-NTT lives over Z[φ] on Z₁₀^B. Whether a precise isomorphism exists is an open question.&lt;/p&gt;




&lt;h2&gt;
  
  
  Try the Minimal Test
&lt;/h2&gt;

&lt;p&gt;The reference implementation &lt;code&gt;phi_carry_free.py&lt;/code&gt; is self-contained pure Python. The 30-second sanity check:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="kn"&gt;from&lt;/span&gt; &lt;span class="n"&gt;phi_carry_free&lt;/span&gt; &lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="n"&gt;phi_conv_carry_free&lt;/span&gt;
&lt;span class="kn"&gt;from&lt;/span&gt; &lt;span class="n"&gt;random&lt;/span&gt; &lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="n"&gt;seed&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;randint&lt;/span&gt;

&lt;span class="nf"&gt;seed&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;42&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="n"&gt;B&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;N&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;3&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;1000&lt;/span&gt;
&lt;span class="n"&gt;x&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;[(&lt;/span&gt;&lt;span class="nf"&gt;randint&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="mi"&gt;5&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;5&lt;/span&gt;&lt;span class="p"&gt;),&lt;/span&gt; &lt;span class="nf"&gt;randint&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt; &lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="n"&gt;_&lt;/span&gt; &lt;span class="ow"&gt;in&lt;/span&gt; &lt;span class="nf"&gt;range&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;N&lt;/span&gt;&lt;span class="p"&gt;)]&lt;/span&gt;
&lt;span class="n"&gt;h&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;[(&lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;)]&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="n"&gt;N&lt;/span&gt;
&lt;span class="n"&gt;h&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;  &lt;span class="c1"&gt;# delta kernel
&lt;/span&gt;
&lt;span class="n"&gt;y&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;phi_conv_carry_free&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;x&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;h&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;B&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="nf"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;delta conv B=3:&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;✓&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt; &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="nf"&gt;all&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;y&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;==&lt;/span&gt; &lt;span class="n"&gt;x&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="n"&gt;i&lt;/span&gt; &lt;span class="ow"&gt;in&lt;/span&gt; &lt;span class="nf"&gt;range&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;N&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt; &lt;span class="k"&gt;else&lt;/span&gt; &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;✗&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;If it prints &lt;code&gt;✓&lt;/code&gt;, the transform is working correctly. The convolution theorem, scale factor divisibility, and exact reconstruction are all confirmed in that one check.&lt;/p&gt;




&lt;p&gt;&lt;em&gt;Source: Handoff notes v2–v12 (2026-02-25) / Reference implementation: phi_carry_free.py&lt;/em&gt;&lt;/p&gt;

</description>
      <category>opensource</category>
      <category>architecture</category>
      <category>frontend</category>
      <category>github</category>
    </item>
    <item>
      <title>φ-NTT: A Carry-Free Transform on Z ^B with Hierarchical Wavelet Structure</title>
      <dc:creator>MORC</dc:creator>
      <pubDate>Sat, 28 Feb 2026 12:32:36 +0000</pubDate>
      <link>https://dev.to/morc_b13/ph-ntt-a-carry-free-transform-on-z-b-with-hierarchical-wavelet-structure-3omb</link>
      <guid>https://dev.to/morc_b13/ph-ntt-a-carry-free-transform-on-z-b-with-hierarchical-wavelet-structure-3omb</guid>
      <description>&lt;h1&gt;
  
  
  φ-NTT: A Carry-Free Transform on Z₁₀^B with Hierarchical Wavelet Structure
&lt;/h1&gt;




&lt;h2&gt;
  
  
  Abstract
&lt;/h2&gt;

&lt;p&gt;We introduce φ-NTT (phi Number Theoretic Transform), a transform defined over the carry-free direct product group Z₁₀^B with coefficients in the golden-ratio integer ring Z[φ] = Z[√5]. The transform achieves exact integer arithmetic with no floating-point error and no inter-stage twiddle factors. The B-stage construction yields a 2^B channel filterbank with a hierarchical wavelet structure analogous to Haar MRA. We establish a Spectral Concentration Quasi-Theorem: for signals with dominant period P ≈ 2·10^b, the detail channel at level b captures energy fraction α_b ≥ C·(1−ε)^{B−1}. Empirically, the top 3 channels cover ≥ 97% of total energy for B = 3..5.&lt;/p&gt;




&lt;h2&gt;
  
  
  1. Introduction
&lt;/h2&gt;

&lt;p&gt;The Fast Fourier Transform (FFT) and its variants are among the most widely deployed algorithms in signal processing and communications. Standard FFT operates on cyclic groups Z/(N) and relies on complex-valued twiddle factors, which introduce floating-point error and prevent exact integer arithmetic.&lt;/p&gt;

&lt;p&gt;In this paper, we introduce the φ-NTT (phi Number Theoretic Transform), a transform defined over the direct product group Z₁₀^B = Z₁₀ × ⋯ × Z₁₀ — the group of B-digit decimal representations with carry-free (digit-wise modular) arithmetic. The key structural features of φ-NTT are:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Exact integer arithmetic&lt;/strong&gt;: all coefficients lie in the ring Z[φ] = Z&lt;a href="https://dev.togolden-ratio%20integer%20ring"&gt;√5&lt;/a&gt;; no floating-point error.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Zero inter-stage twiddle factors&lt;/strong&gt;: the tensor-product theorem eliminates all cross-stage phase corrections over B recursive stages.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;2^B channel filterbank&lt;/strong&gt;: the B-stage transform decomposes a length-10^B signal into 2^B channels, labeled by binary strings over {T, U}, where T denotes a C₅-twisted low-pass projection and U denotes a Z₂ high-pass (parity) projection.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The carry-free arithmetic setting — where each decimal digit evolves independently — naturally gives rise to a hierarchical wavelet structure analogous to the Haar multiresolution analysis (MRA), but defined over the ring Z[φ] and indexed by decimal digits rather than binary positions. We formalize this analogy and prove a Spectral Concentration Quasi-Theorem: for signals with dominant period P ≈ 2·10^b, the detail channel at level b captures a fraction α_b ≥ C·(1−ε)^{B−1} of total signal energy. Empirically, the top 3 channels cover ≥ 97% of energy for B = 3..5.&lt;/p&gt;

&lt;p&gt;The remainder of this paper is organized as follows. Section 2 defines φ-NTT and the convolution theorem on Z₁₀^B. Section 3 develops the hierarchical wavelet interpretation. Section 4 states and sketches the proof of the quasi-theorem. Section 5 presents numerical experiments for B = 1..5. Section 6 discusses open problems, including the exact orthogonality of T/U projections and the determination of constants C and ε. Section 7 concludes.&lt;/p&gt;




&lt;h2&gt;
  
  
  2. φ-NTT on Z₁₀^B
&lt;/h2&gt;

&lt;h3&gt;
  
  
  2.1 Carry-Free Group Structure
&lt;/h3&gt;

&lt;p&gt;Let B be a positive integer and N = 10^B. We represent each index n ∈ {0, …, N−1} by its decimal digit expansion&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;n = d₀(n) + 10·d₁(n) + ⋯ + 10^{B−1}·d_{B−1}(n),   dᵢ(n) ∈ {0,…,9}.
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;The carry-free group Z₁₀^B is the direct product Z₁₀ × ⋯ × Z₁₀ (B copies), with addition defined digit-wise:&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;(n ⊕ m)ᵢ = (dᵢ(n) + dᵢ(m)) mod 10.
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;This differs fundamentally from ordinary modular arithmetic on Z/(10^B)Z, where addition carries across digit boundaries. The two groups coincide only at B = 1; for B ≥ 2 they are non-isomorphic, and the standard cyclic convolution theorem does not apply to Z₁₀^B.&lt;/p&gt;

&lt;p&gt;The carry-free subtraction and negation are defined analogously:&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;cf_sub(n, m)ᵢ = (dᵢ(n) − dᵢ(m)) mod 10,
cf_neg(n)ᵢ   = (−dᵢ(n)) mod 10.
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;All arithmetic in φ-NTT operates over the ring Z[φ] = Z[√5], where φ = (1+√5)/2. Elements are pairs (a, b) ∈ Z² representing a + b·φ, with multiplication&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;(a, b) · (c, d) = (ac + bd, ad + bc + bd).
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;This eliminates floating-point error entirely.&lt;/p&gt;

&lt;h3&gt;
  
  
  2.2 Definition of φ-NTT
&lt;/h3&gt;

&lt;p&gt;For B = 1 (length N = 10), the transform decomposes the input x : Z₁₀ → Z[φ] into two channels via the isomorphism Z₁₀ ≅ Z₂ × Z₅ (Chinese Remainder Theorem):&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;T-channel:  X_T[k] = n10_T(x)[k]   (C₅-twisted DFT projection)
U-channel:  X_U[k] = n10_U(x)[k]   (Z₂ parity projection)
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;The C₅-twisted DFT uses the basis elements cos5_zphi(m) ∈ {(2,0),(−1,1),(0,−1)} — three distinct values in Z[φ], with no irrational twiddle factors at runtime. The Z₂ projection uses the parity kernel U₁[k] ∈ {(0,0),(±1,0),(0,±1)}. Explicit tables are given in Appendix A.&lt;/p&gt;

&lt;p&gt;For general B, the transform is defined by a B-stage tensor product. At each stage b ∈ {0,…,B−1}, the input is projected onto either the T-channel (low-pass, C₅ side) or the U-channel (high-pass, Z₂ side). This yields 2^B output channels, each labeled by a binary string over {T, U}^B:&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;bn_forward_flat(x, B) → [ch_s : s ∈ {T,U}^B],   each ch_s : Z₁₀^B → Z[φ].
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;The inverse transform bn_inverse_flat reconstructs x exactly, with a scale factor of 40^B (no convolution) or 80^B = 40^B × 2^B (after channel-domain convolution). Both scale factors divide exactly in Z[φ], so reconstruction is lossless over the integers.&lt;/p&gt;

&lt;p&gt;A key structural property is that no inter-stage twiddle factors appear: the tensor-product theorem over Z₁₀^B guarantees that all cross-stage phase corrections vanish across all B recursive stages.&lt;/p&gt;

&lt;h3&gt;
  
  
  2.3 Convolution Theorem (Carry-Free)
&lt;/h3&gt;

&lt;p&gt;Define the carry-free convolution of x, h : Z₁₀^B → Z[φ] as&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;(x ⋆ h)[n] = Σ_{m} h[m] · x[cf_sub(n, m)],   n ∈ Z₁₀^B.
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;&lt;strong&gt;Theorem (Carry-Free Convolution).&lt;/strong&gt; Let F_B denote the φ-NTT forward transform. Then F_B diagonalizes carry-free convolution on Z₁₀^B: the channel-domain product&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Y_s[k] = X_s[k] · H_s[k]   (with the T/U cross-coupling rule)
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;recovers x ⋆ h upon inverse transform, up to the scale factor 80^B. The T/U cross-coupling at each stage is:&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;2·Y_T[k] = X_T[k]·H_T[k] − SIN2 · X_U[k]·H_U[k]
2·Y_U[k] = X_T[k]·H_U[k] + X_U[k]·H_T[k]
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;where SIN2 = (3,−1) ∈ Z[φ] ≈ 1.382 = 4sin²(2π/10). This has been verified for B = 1..5 against direct computation.&lt;/p&gt;

&lt;p&gt;Similarly, carry-free cross-correlation reduces to convolution with the carry-free-reversed kernel h_rev[m] = h[cf_neg(m)].&lt;/p&gt;




&lt;h2&gt;
  
  
  3. Hierarchical Wavelet Interpretation
&lt;/h2&gt;

&lt;p&gt;The recursive T/U decomposition induces a hierarchical structure on Z₁₀^B that parallels multiresolution analysis (MRA).&lt;/p&gt;

&lt;h3&gt;
  
  
  3.1 T/U as Projection-Like Operators
&lt;/h3&gt;

&lt;p&gt;At each stage b ∈ {0,…,B−1}, the φ-NTT applies one of two projection-like operators to the digit d_b:&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;T_b : low-pass side  (C₅-twisted DFT projection)
      extracts the slowly-varying component across d_b ∈ {0,…,9}

U_b : high-pass side (Z₂ parity projection)
      extracts the alternating component  (−1)^{d_b}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;Together, T_b and U_b partition the information in digit b in a manner analogous to a two-channel filter bank. We use the term &lt;em&gt;projection-like&lt;/em&gt; deliberately: while the numerical experiments confirm that energy is partitioned across channels without loss (exact reconstruction holds for all B = 1..5), the strict algebraic orthogonality T_b ⊥ U_b has not yet been proved and is left as an open problem (Section 6).&lt;/p&gt;

&lt;p&gt;The B-stage tensor product applies these operators independently at each digit position, yielding 2^B channels:&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;ch_s = (⊗_{b=0}^{B-1} P_b^{s_b})(x),   s ∈ {T,U}^B,
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;where P_b^T = T_b and P_b^U = U_b. The full signal energy is distributed across all 2^B channels, and exact reconstruction is guaranteed by bn_inverse_flat.&lt;/p&gt;

&lt;h3&gt;
  
  
  3.2 Binary Tree Interpretation
&lt;/h3&gt;

&lt;p&gt;The label set {T,U}^B is in natural bijection with the set of root-to-leaf paths in a complete binary tree of depth B. Reading the label from left (most significant digit, b = B−1) to right (least significant, b = 0):&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;          root
        /       \
     T(d_{B-1})  U(d_{B-1})
       /   \       /   \
     T      U    T      U
    (d_{B-2}) …
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Each leaf corresponds to one channel. The channel TT…T (all T, leftmost leaf) captures the coarsest approximation; the channel UU…U (all U, rightmost leaf) captures the finest detail — the checkerboard pattern across all digit positions simultaneously.&lt;/p&gt;

&lt;p&gt;This structure is structurally analogous to Haar MRA, but not identical. The key correspondences and differences are:&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Property&lt;/th&gt;
&lt;th&gt;Haar MRA&lt;/th&gt;
&lt;th&gt;φ-NTT&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Signal length&lt;/td&gt;
&lt;td&gt;2^B&lt;/td&gt;
&lt;td&gt;10^B&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Channels&lt;/td&gt;
&lt;td&gt;2^B&lt;/td&gt;
&lt;td&gt;2^B&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Approximation coeff.&lt;/td&gt;
&lt;td&gt;scaling function&lt;/td&gt;
&lt;td&gt;TT…T channel&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Detail coeff.&lt;/td&gt;
&lt;td&gt;wavelet function&lt;/td&gt;
&lt;td&gt;T…TU_bT…T channels&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Arithmetic&lt;/td&gt;
&lt;td&gt;real (±1 basis)&lt;/td&gt;
&lt;td&gt;Z[φ] basis&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Orthogonality&lt;/td&gt;
&lt;td&gt;exact&lt;/td&gt;
&lt;td&gt;conjectured&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;The analogy enables direct transfer of Haar intuitions: a smooth signal concentrates in approximation (T-dominant) channels, while rapid oscillations populate detail (U-heavy) channels.&lt;/p&gt;

&lt;h3&gt;
  
  
  3.3 Energy Localization Mechanism
&lt;/h3&gt;

&lt;p&gt;The tree structure predicts how signal energy distributes across channels, depending on the signal's smoothness and dominant period.&lt;/p&gt;

&lt;p&gt;Smooth signals vary slowly across all digit positions. The U_b operator measures the parity alternation (−1)^{d_b} at digit b; if x changes little between even and odd values of d_b, the U_b inner product is small. Accumulating this across B stages, the UU…U channel — which requires large alternation at every digit simultaneously — is driven toward zero. This explains the empirical observation (B = 3..5) that the UU…U channel carries &amp;lt; 0.01% of total energy for smooth signals.&lt;/p&gt;

&lt;p&gt;Signals with a dominant period P ≈ 2·10^b exhibit strong alternation specifically at digit b, while other digits vary slowly. The U_b projection then captures the bulk of the oscillatory energy, while T projections at all other stages pass through the slowly varying envelope. The result is that the channel T…T[U_b]T…T (U only at position b) becomes the dominant channel. For the test signal sin(2π·n/100) with P = 100 ≈ 2·10¹, this predicts the TUT…T channel as dominant — consistent with all B = 3..5 experiments (86%, 69%, 68% of total energy respectively).&lt;/p&gt;

&lt;p&gt;The precise quantification of this concentration — a lower bound on the fraction α_b captured by the dominant channel — is the subject of Section 4.&lt;/p&gt;




&lt;h2&gt;
  
  
  4. Spectral Concentration
&lt;/h2&gt;

&lt;p&gt;We formalize the observed concentration phenomenon in the form of a quasi-theorem.&lt;/p&gt;

&lt;h3&gt;
  
  
  4.1 Statement
&lt;/h3&gt;

&lt;p&gt;We work under two assumptions on the input signal x : Z₁₀^B → Z&lt;a href="//real-valued,%20i.e.,%20second%20component%20identically%200"&gt;φ&lt;/a&gt;:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;(A1) Digit-wise smoothness.&lt;/strong&gt; For each digit position b' ≠ b, the variation of x across d_{b'} is small relative to the variation across d_b:&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;|variation(x, b')| ≤ ε · |variation(x, b)|,   b' ≠ b,
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;for some constant 0 &amp;lt; ε &amp;lt; 1. Here variation(x, b) measures the mean absolute change in x as digit b steps through {0,…,9}.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;(A2) Dominant period.&lt;/strong&gt; The signal has a dominant period P ≈ 2·10^b for some b ∈ {0,…,B−1}, so that d_b is the primary source of oscillation.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Quasi-Theorem (φ-NTT Spectral Concentration).&lt;/strong&gt; Under assumptions (A1) and (A2), there exist constants C &amp;gt; 0 and 0 &amp;lt; ε &amp;lt; 1 (depending on the signal class) such that the energy fraction captured by the level-b detail channel satisfies&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;α_b  =  E[ch_{T…TU_bT…T}] / E_total  ≥  C · (1 − ε)^{B−1}.
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;Furthermore, the remaining energy is distributed such that the top 3 channels (by energy) jointly satisfy&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;α_b + α_{b,2} + α_{b,3}  ≥  1 − δ
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;for a small residual δ, empirically δ &amp;lt; 0.03 for B = 3..5.&lt;/p&gt;

&lt;p&gt;We call this a &lt;em&gt;quasi-theorem&lt;/em&gt; because the constants C and ε are characterized implicitly through (A1)–(A2) rather than given in closed form, and because the strict algebraic orthogonality of the T/U decomposition — while consistent with all numerical evidence — remains unproved (see Section 6).&lt;/p&gt;

&lt;h3&gt;
  
  
  4.2 Interpretation
&lt;/h3&gt;

&lt;p&gt;The bound C · (1−ε)^{B−1} has a transparent structure:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;ε measures the digit-level roughness of the signal: how much energy "leaks" from the dominant digit b to each of the other B−1 digits. For a clean periodic signal, ε is small.&lt;/li&gt;
&lt;li&gt;(1−ε)^{B−1} is the product of B−1 suppression factors, one per non-dominant digit stage. The bound decays exponentially in B, which explains why the observed α_b decreases from 86% (B=3) to 68% (B=4,5) as more stages accumulate leakage.&lt;/li&gt;
&lt;li&gt;C absorbs the baseline energy ratio at the dominant stage itself. It depends on how cleanly the signal period aligns with 2·10^b.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The exponential decay in B is a structural feature, not a defect: it reflects the fact that with more digit stages, more channels compete for energy. The top-3 coverage (≥ 97%) remains stable because the two nearest channels — at levels b±1 — absorb most of the leakage.&lt;/p&gt;

&lt;h3&gt;
  
  
  4.3 Proof Sketch
&lt;/h3&gt;

&lt;p&gt;We sketch the structure of the argument; a complete algebraic proof is left for future work.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Step 1&lt;/strong&gt; (Digit smoothness → U energy bound). By (A1), for each b' ≠ b, the U_{b'} projection — which measures parity alternation at digit b' — has small inner product with x. This gives E[U_{b'}] ≤ ε² · E[U_b] for b' ≠ b.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Step 2&lt;/strong&gt; (Dominant digit → U_b lower bound). By (A2), x oscillates with period ≈ 2·10^b, so x correlates strongly with the Z₂ parity indicator (−1)^{d_b}. This is precisely the kernel of U_b, yielding E[U_b] ≥ C₀ · E_total for some C₀ &amp;gt; 0.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Step 3&lt;/strong&gt; (Tensor product → multiplicative separation). Because the B-stage decomposition applies each operator independently at each digit, the channel T…TU_bT…T receives energy from U_b at stage b and T at all other stages. The T projections at stages b'≠b pass through the slowly varying envelope (contributing factor ≈ 1), while the U_{b'} channels at those stages are suppressed by ε per stage.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Step 4&lt;/strong&gt; (Normalization → α_b lower bound). Summing the energy across all 2^B channels and normalizing yields the lower bound α_b ≥ C · (1−ε)^{B−1}, where C absorbs C₀ and the T-stage pass-through factors.&lt;/p&gt;

&lt;h3&gt;
  
  
  4.4 Empirical Alignment
&lt;/h3&gt;

&lt;p&gt;The quasi-theorem is consistent with the numerical experiments (B = 3..5, test signal sin(2π·n/100), P = 100 ≈ 2·10¹, b = 1):&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;B&lt;/th&gt;
&lt;th&gt;α_b (observed)&lt;/th&gt;
&lt;th&gt;Lower bound structure&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;3&lt;/td&gt;
&lt;td&gt;0.864&lt;/td&gt;
&lt;td&gt;C·(1−ε)² with ε ≈ 0.07&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;4&lt;/td&gt;
&lt;td&gt;0.687&lt;/td&gt;
&lt;td&gt;C·(1−ε)³&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;5&lt;/td&gt;
&lt;td&gt;0.682&lt;/td&gt;
&lt;td&gt;C·(1−ε)⁴&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;In all cases, the top 3 channels jointly cover ≥ 97% of total energy, consistent with the δ &amp;lt; 0.03 claim. The UU…U channel carries &amp;lt; 0.01% in all experiments, consistent with the checkerboard suppression argument of Section 3.3.&lt;/p&gt;

&lt;p&gt;The specific values of C and ε are not fitted here; the table is presented solely to show that the observed decay is consistent with the lower-bound structure C·(1−ε)^{B−1}.&lt;/p&gt;




&lt;h2&gt;
  
  
  5. Numerical Experiments
&lt;/h2&gt;

&lt;h3&gt;
  
  
  5.1 Experimental Setup
&lt;/h3&gt;

&lt;p&gt;All experiments use the reference implementation phi_carry_free.py, operating entirely in exact integer arithmetic over Z[φ]. No floating-point operations are involved in the transform itself; zval() (evaluation to float) is used only for energy measurement in post-processing.&lt;/p&gt;

&lt;p&gt;We test B = 1..5 (signal lengths N = 10 to 100,000) with a low-frequency test signal&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;x[n] = sin(2π·n/100) + sin(2π·n/P₂) + noise,
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;where P₂ is a secondary period scaled to N and noise is small integer perturbation. This signal class satisfies assumptions (A1)–(A2) of Section 4 with dominant period P = 100 ≈ 2·10¹ (b=1).&lt;/p&gt;

&lt;p&gt;Correctness is verified in two ways: (i) direct comparison of phi_conv_carry_free against the reference O(N²) carry-free convolution, and (ii) round-trip test with a delta kernel h = δ₀, confirming exact reconstruction for all B = 1..5.&lt;/p&gt;

&lt;h3&gt;
  
  
  5.2 Channel Energy Distribution
&lt;/h3&gt;

&lt;p&gt;Table 1 shows the energy fraction of the top-3 channels and the UU…U channel for B = 3..5. All fractions are computed as&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;E[ch] / E_total,   E[ch] = (1/N) Σ_k (zval(ch[k]))²   (real-valued signal assumption).
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;&lt;strong&gt;Table 1. Channel energy distribution (low-frequency test signal)&lt;/strong&gt;&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;B&lt;/th&gt;
&lt;th&gt;#1 channel&lt;/th&gt;
&lt;th&gt;α₁&lt;/th&gt;
&lt;th&gt;#2 channel&lt;/th&gt;
&lt;th&gt;α₂&lt;/th&gt;
&lt;th&gt;#3 channel&lt;/th&gt;
&lt;th&gt;α₃&lt;/th&gt;
&lt;th&gt;Top-3&lt;/th&gt;
&lt;th&gt;UU…U&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;3&lt;/td&gt;
&lt;td&gt;TUT&lt;/td&gt;
&lt;td&gt;86.4%&lt;/td&gt;
&lt;td&gt;TTT&lt;/td&gt;
&lt;td&gt;11.1%&lt;/td&gt;
&lt;td&gt;UTT&lt;/td&gt;
&lt;td&gt;2.3%&lt;/td&gt;
&lt;td&gt;99.8%&lt;/td&gt;
&lt;td&gt;&amp;lt;0.01%&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;4&lt;/td&gt;
&lt;td&gt;TUTT&lt;/td&gt;
&lt;td&gt;68.7%&lt;/td&gt;
&lt;td&gt;TTUT&lt;/td&gt;
&lt;td&gt;17.7%&lt;/td&gt;
&lt;td&gt;TTTT&lt;/td&gt;
&lt;td&gt;11.7%&lt;/td&gt;
&lt;td&gt;98.1%&lt;/td&gt;
&lt;td&gt;&amp;lt;0.01%&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;5&lt;/td&gt;
&lt;td&gt;TUTTT&lt;/td&gt;
&lt;td&gt;68.2%&lt;/td&gt;
&lt;td&gt;TTTUT&lt;/td&gt;
&lt;td&gt;17.7%&lt;/td&gt;
&lt;td&gt;TTTTT&lt;/td&gt;
&lt;td&gt;11.7%&lt;/td&gt;
&lt;td&gt;97.6%&lt;/td&gt;
&lt;td&gt;&amp;lt;0.01%&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;Three observations are immediate. First, the dominant channel is consistently of the form T…TU₁T…T (U only at digit b=1), in agreement with the prediction of Section 4 for P ≈ 2·10¹. Second, the top-3 channels jointly cover ≥ 97% of total energy across all tested values of B, consistent with the δ &amp;lt; 0.03 claim of the quasi-theorem. Third, the UU…U channel carries negligible energy (&amp;lt; 0.01%) in all cases, consistent with the checkerboard suppression argument of Section 3.3.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Table 2. SNR vs. retained channels (low-frequency signal, B=3..5)&lt;/strong&gt;&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;B&lt;/th&gt;
&lt;th&gt;1 ch&lt;/th&gt;
&lt;th&gt;2 ch&lt;/th&gt;
&lt;th&gt;4 ch&lt;/th&gt;
&lt;th&gt;All ch&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;3&lt;/td&gt;
&lt;td&gt;9.5 dB&lt;/td&gt;
&lt;td&gt;15.4 dB&lt;/td&gt;
&lt;td&gt;28.5 dB&lt;/td&gt;
&lt;td&gt;∞ (exact)&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;4&lt;/td&gt;
&lt;td&gt;5.3 dB&lt;/td&gt;
&lt;td&gt;9.5 dB&lt;/td&gt;
&lt;td&gt;20.5 dB&lt;/td&gt;
&lt;td&gt;∞ (exact)&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;5&lt;/td&gt;
&lt;td&gt;5.2 dB&lt;/td&gt;
&lt;td&gt;9.3 dB&lt;/td&gt;
&lt;td&gt;18.5 dB&lt;/td&gt;
&lt;td&gt;∞ (exact)&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;The "∞ (exact)" entries confirm lossless reconstruction when all channels are retained.&lt;/p&gt;

&lt;h3&gt;
  
  
  5.3 Reconstruction Accuracy
&lt;/h3&gt;

&lt;p&gt;Exact reconstruction is guaranteed by the algebraic structure of φ-NTT, not by numerical precision. The scale factors 40^B (round-trip) and 80^B (after convolution) divide exactly in Z[φ], as verified by assertion checks for all B = 1..5:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="k"&gt;assert&lt;/span&gt; &lt;span class="n"&gt;v&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;%&lt;/span&gt; &lt;span class="n"&gt;scale&lt;/span&gt; &lt;span class="o"&gt;==&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt; &lt;span class="ow"&gt;and&lt;/span&gt; &lt;span class="n"&gt;v&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;%&lt;/span&gt; &lt;span class="n"&gt;scale&lt;/span&gt; &lt;span class="o"&gt;==&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;   &lt;span class="c1"&gt;# holds for all v
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;No floating-point rounding occurs at any stage. The delta-kernel test phi_conv_carry_free(x, δ₀, B) == x passes for all tested inputs and all B = 1..5, confirming the convolution theorem of Section 2.3.&lt;/p&gt;

&lt;h3&gt;
  
  
  5.4 Computational Structure
&lt;/h3&gt;

&lt;p&gt;The φ-NTT avoids two sources of complexity common in FFT implementations. First, there are no inter-stage twiddle factors: all phase corrections vanish by the tensor-product theorem over Z₁₀^B. Second, all arithmetic is integer-valued; the only divisions are the final scale-factor normalizations, which are exact. The transform operates on length-10^B signals with 2^B output channels in O(N · B) integer operations per stage. Detailed complexity analysis and comparison with FFT are reserved for future work.&lt;/p&gt;




&lt;h2&gt;
  
  
  6. Discussion
&lt;/h2&gt;

&lt;h3&gt;
  
  
  6.1 Open Problems
&lt;/h3&gt;

&lt;p&gt;Three problems remain open and are reserved for future work.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;(P1) Orthogonality of T/U projections.&lt;/strong&gt; The numerical experiments confirm that energy is partitioned across channels without loss, and that exact reconstruction holds for all tested B. However, the strict algebraic orthogonality T_b ⊥ U_b over Z[φ] has not been proved. Establishing this would upgrade the quasi-theorem of Section 4 to a full theorem, with C and ε determined by the projection geometry.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;(P2) Closed-form determination of C and ε.&lt;/strong&gt; The constants C and ε in Theorem 4.1 are currently characterized implicitly through assumptions (A1)–(A2). Deriving explicit expressions — presumably in terms of the signal period P, the digit base 10, and the Z[φ] basis elements — would make the spectral concentration bound fully quantitative and signal-class independent.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;(P3) Connection to carry-based convolution (overlap-add).&lt;/strong&gt; The present work is restricted to carry-free convolution on Z₁₀^B. A natural extension is to bridge this to ordinary cyclic convolution on Z/(10^B)Z via an overlap-add scheme, which would enable φ-NTT-based filtering of standard integer sequences. The group non-isomorphism Z₁₀^B ≇ Z/(10^B)Z (for B ≥ 2) means this bridge is non-trivial and requires a separate treatment.&lt;/p&gt;

&lt;h3&gt;
  
  
  6.2 Relation to Existing Frameworks
&lt;/h3&gt;

&lt;p&gt;&lt;strong&gt;vs. FFT.&lt;/strong&gt; Standard FFT operates on the cyclic group Z/(N)Z with complex twiddle factors, accumulating floating-point error. φ-NTT operates on the direct product group Z₁₀^B with coefficients in Z[φ], achieving exact integer arithmetic. The two transforms diagonalize different convolution algebras and are not interchangeable.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;vs. Haar MRA.&lt;/strong&gt; The binary tree structure of Section 3 is structurally analogous to Haar multiresolution analysis, with T playing the role of the scaling function and U the wavelet. The analogy is genuine but inexact: Haar operates over R with ±1 basis on Z/(2^B)Z, while φ-NTT uses Z[φ] basis on Z₁₀^B. Whether a precise isomorphism exists between the two filterbanks is an open question.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;vs. NTT (Number Theoretic Transform).&lt;/strong&gt; Classical NTT replaces complex roots of unity with modular arithmetic roots, but retains the cyclic group structure Z/(N)Z. φ-NTT differs in using the direct product group Z₁₀^B and the ring Z[φ], which is not a finite field. This gives exact arithmetic over the integers at the cost of the non-standard group structure.&lt;/p&gt;

&lt;h3&gt;
  
  
  6.3 Limitations
&lt;/h3&gt;

&lt;p&gt;The current work has three explicit limitations.&lt;/p&gt;

&lt;p&gt;First, all results are restricted to the carry-free setting on Z₁₀^B. Signals defined with ordinary decimal arithmetic — where addition carries across digit boundaries — are not directly handled by φ-NTT without preprocessing.&lt;/p&gt;

&lt;p&gt;Second, only the group Z₁₀^B (decimal digit base) is treated. Extension to other bases (e.g., Z_p^B for prime p, or mixed-radix groups) may yield analogous transforms, but the specific role of φ = (1+√5)/2 and the ring Z[φ] is tied to the factorization 10 = 2 × 5.&lt;/p&gt;

&lt;p&gt;Third, all experiments use synthetic signals. Application to real-world data — audio, time series, integer sequences — has not been tested and may require adaptation of the carry-free indexing to practical data formats.&lt;/p&gt;




&lt;h2&gt;
  
  
  7. Conclusion
&lt;/h2&gt;

&lt;p&gt;We have introduced φ-NTT, a transform on the carry-free group Z₁₀^B with coefficients in the golden-ratio integer ring Z[φ]. The main contributions are threefold.&lt;/p&gt;

&lt;p&gt;First, φ-NTT diagonalizes carry-free convolution on Z₁₀^B exactly, with no floating-point error and no inter-stage twiddle factors. The scale factors 40^B and 80^B divide exactly in Z[φ], making reconstruction provably lossless.&lt;/p&gt;

&lt;p&gt;Second, the 2^B channel filterbank admits a hierarchical wavelet interpretation: the T/U label at each stage corresponds to a low-pass or high-pass projection at that digit level, structurally analogous to Haar MRA but defined over Z[φ] and indexed by decimal digits.&lt;/p&gt;

&lt;p&gt;Third, we establish a Spectral Concentration Quasi-Theorem: under digit-wise smoothness and a dominant-period assumption, the energy fraction captured by the level-b detail channel satisfies α_b ≥ C·(1−ε)^{B−1}. Empirically, the top 3 channels cover ≥ 97% of total energy for B = 3..5, validating the bound structure.&lt;/p&gt;

&lt;p&gt;Open problems include the algebraic proof of T/U orthogonality (P1), closed-form determination of C and ε (P2), and the connection to carry-based convolution via overlap-add (P3).&lt;/p&gt;

&lt;p&gt;The φ-NTT suggests that hierarchical, carry-free arithmetic structures may offer an alternative perspective on multiresolution transforms beyond cyclic Fourier analysis.&lt;/p&gt;




&lt;h2&gt;
  
  
  Appendix A: cos5_zphi Table and T/U Kernel Tables
&lt;/h2&gt;

&lt;p&gt;The C₅-twisted DFT basis elements used in n10_T:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;cos5_zphi(m) for m = 0..4:
  m=0: (2, 0)    ≈  2.000
  m=1: (-1, 1)   ≈  0.618
  m=2: (0, -1)   ≈ -1.618
  m=3: (0, -1)   ≈ -1.618
  m=4: (-1, 1)   ≈  0.618
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The Z₂ parity kernel used in n10_U:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;U1[k] for k = 0..9:
  [(0,0),(1,0),(0,1),(0,1),(1,0),(0,0),(-1,0),(0,-1),(0,-1),(-1,0)]
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The inverse kernel T2[k] for k = 0..9:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;T2 = [(2,0),(0,1),(-1,1),(1,-1),(0,-1),(-2,0),(0,-1),(1,-1),(-1,1),(0,1)]
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h2&gt;
  
  
  Appendix B: perm10 and CRT Derivation
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;perm10 = [(5*(i//5) + 6*(i%5)) % 10 for i in range(10)]
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This implements the CRT inverse map Z₁₀ ≅ Z₂ × Z₅:&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;n = 5·a + 6·b  (mod 10)
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;where a is the Z₅ component and b is the Z₂ component. The coefficient 6 satisfies 6 ≡ 1 (mod 5) and 6 ≡ 0 (mod 2), providing the Z₂ unit lift. Furthermore, 6 ≡ 3 (mod 5) induces the automorphism φ₃ (×3 map) on Z₅, which is consistent with the twiddle structure of the C₅ twisted DFT.&lt;/p&gt;




&lt;h2&gt;
  
  
  Appendix C: Scale Factor Decomposition (80^B = 40^B × 2^B)
&lt;/h2&gt;

&lt;p&gt;The total scale factor 80^B arises from two independent sources:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;40^B&lt;/strong&gt;: the forward/inverse normalization factor accumulated over B tensor-product stages (each B=1 stage contributes factor 40).&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;2^B&lt;/strong&gt;: the T/U cross-coupling rule &lt;code&gt;2·Y_T = ...&lt;/code&gt; introduces a factor of 2 per stage; over B stages this accumulates to 2^B.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Therefore:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;bn_inverse_flat&lt;/code&gt; alone (no convolution): divide by &lt;strong&gt;40^B&lt;/strong&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;phi_conv_carry_free&lt;/code&gt; (with convolution): divide by &lt;strong&gt;80^B = 40^B × 2^B&lt;/strong&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Both divisions are exact in Z&lt;a href="//verified%20by%20assertion%20for%20all%20B%20=%201..5"&gt;φ&lt;/a&gt;:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="k"&gt;assert&lt;/span&gt; &lt;span class="n"&gt;v&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;%&lt;/span&gt; &lt;span class="n"&gt;scale&lt;/span&gt; &lt;span class="o"&gt;==&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt; &lt;span class="ow"&gt;and&lt;/span&gt; &lt;span class="n"&gt;v&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;%&lt;/span&gt; &lt;span class="n"&gt;scale&lt;/span&gt; &lt;span class="o"&gt;==&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



</description>
      <category>algorithms</category>
      <category>computerscience</category>
      <category>science</category>
    </item>
    <item>
      <title>仕様セクション：H-Carrier（有用残差再注入）伝播と安定制御</title>
      <dc:creator>MORC</dc:creator>
      <pubDate>Thu, 26 Feb 2026 08:07:47 +0000</pubDate>
      <link>https://dev.to/morc_b13/shi-yang-sekusiyonh-carrieryou-yong-can-chai-zai-zhu-ru-chuan-bo-toan-ding-zhi-yu-i9d</link>
      <guid>https://dev.to/morc_b13/shi-yang-sekusiyonh-carrieryou-yong-can-chai-zai-zhu-ru-chuan-bo-toan-ding-zhi-yu-i9d</guid>
      <description>&lt;h2&gt;
  
  
  仕様セクション：H-Carrier（有用残差再注入）伝播と安定制御
&lt;/h2&gt;

&lt;h3&gt;
  
  
  概要
&lt;/h3&gt;

&lt;p&gt;本プロセッサは、ユニット内部で発生する残差（排熱）Hを単なる損失として捨てず、&lt;br&gt;
次段（または次ステップ）のしきい値・結合係数・減衰率に対する &lt;strong&gt;適応型バイアス&lt;/strong&gt; として再利用する。&lt;br&gt;
ただし、Hの無条件再注入はフィードバック発振・ドリフト・飽和を招くため、&lt;br&gt;
以下の3つのガードレール（安定条件）を &lt;strong&gt;I/O仕様として必須&lt;/strong&gt; とする。&lt;/p&gt;




&lt;h3&gt;
  
  
  1. Hの有用性保証（Threshold Gate）
&lt;/h3&gt;

&lt;p&gt;&lt;strong&gt;目的&lt;/strong&gt;：微小な定常ノイズ（量子化誤差・熱雑音相当）を循環させず、信号の急変（エッジ）に対応する有用残差のみをキャリアする。&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;定義（分解）&lt;/strong&gt;：&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;H_s：符号付き残差（signed residual）&lt;/li&gt;
&lt;li&gt;H_m：残差強度（magnitude / energy）&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;例（1サンプル/1タイルいずれでも可）：&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;H_s := mean(heat)  または  sum(heat)&lt;/li&gt;
&lt;li&gt;H_m := mean(|heat|) または sum(|heat|) または sqrt(sum(heat^2))&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;閾値ゲート&lt;/strong&gt;：&lt;br&gt;
ユニット固有のノイズフロアを閾値 τ とし、H_m が τ を超える場合のみ再注入を許可する。&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;ゲート係数：

&lt;ul&gt;
&lt;li&gt;g := clip((H_m - τ) / κ, 0, 1)
（κ はゲートの立ち上がり幅。κ→0 で hard gate、κ&amp;gt;0 で soft gate）&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;

&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;再注入バイアス（基本形）&lt;/strong&gt;：&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;b := α · g · H_s&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;備考（推奨）&lt;/strong&gt;：&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;τ は「量子化誤差相当」＋「環境雑音下の安全マージン」で設定する。&lt;/li&gt;
&lt;li&gt;L/R交差注入に用いる場合、Hは差分残差（differential residual）として構成し、common-mode成分を抑制する。&lt;/li&gt;
&lt;/ul&gt;




&lt;h3&gt;
  
  
  2. リーク積分によるドリフト防止（Leaky Integration）
&lt;/h3&gt;

&lt;p&gt;&lt;strong&gt;目的&lt;/strong&gt;：Hの再注入が蓄積してDCオフセット化し、飽和・偏り・環境変化への追従遅れを起こすことを防ぐ。&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;リーク付き蓄積&lt;/strong&gt;：&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Ĥ_s[t] := (1 - λ) · Ĥ_s[t-1] + λ · H_s[t]
（0 &amp;lt; λ ≤ 1）&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;同様に強度側も必要なら：&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Ĥ_m[t] := (1 - λ_m) · Ĥ_m[t-1] + λ_m · H_m[t]&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;再注入&lt;/strong&gt;：&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;b[t] := α · g[t] · Ĥ_s[t]&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;仕様パラメータ&lt;/strong&gt;：&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;λ（リーク係数）：忘却の速さ（時間定数）

&lt;ul&gt;
&lt;li&gt;λ が小さいほど「ゆっくり適応」、大きいほど「素早く適応」&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;

&lt;li&gt;設計ルール（推奨）：ユースケースに応じて λ を定め、急変ノイズ環境でドリフトしないことを確認する。&lt;/li&gt;

&lt;/ul&gt;




&lt;h3&gt;
  
  
  3. ループ利得の拘束（Stability Loop-Gain Constraint）
&lt;/h3&gt;

&lt;p&gt;&lt;strong&gt;目的&lt;/strong&gt;：H-Carrier再注入が正帰還として暴走することを防ぎ、全入力条件で実用上の安定を担保する。&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;基本制約（十分条件）&lt;/strong&gt;：&lt;br&gt;
再注入の実効ループ利得を 1 未満に拘束する。&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;実効利得：

&lt;ul&gt;
&lt;li&gt;G_eff := |α| · g_max · C&lt;/li&gt;
&lt;li&gt;要件：G_eff &amp;lt; 1&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;

&lt;/ul&gt;

&lt;p&gt;ここで、&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;α：再注入利得（設計パラメータ）&lt;/li&gt;
&lt;li&gt;g_max：ゲート係数の最大値（通常 1）&lt;/li&gt;
&lt;li&gt;C：ユニットの結合増幅係数（トポロジーと更新則に依存する上界）&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;逆フィボナッチ収束係数との相関（推奨）&lt;/strong&gt;：&lt;br&gt;
本系は収束更新で INV_PHI = φ^{-1} を用いるため、保守的には以下を推奨する：&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;|α| ≤ (1 - INV_PHI) · β
（0 &amp;lt; β &amp;lt; 1 は安全率。例：β=0.5〜0.9）&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;直観：&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;INV_PHI が大きい（収束が弱い）ほど、α を小さくする必要がある。&lt;/li&gt;
&lt;li&gt;収束が強いほど、H-Carrierを許容できる。&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;実装上の注意&lt;/strong&gt;：&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;飽和（clip）を必須とし、バイアスbの上限 |b| ≤ b_max を設ける。&lt;/li&gt;
&lt;li&gt;ユニット間交差注入（L↔R）の場合、帯域/モード限定（または差分残差化）と組み合わせる。&lt;/li&gt;
&lt;/ul&gt;




&lt;h3&gt;
  
  
  I/O仕様（最小セット）
&lt;/h3&gt;

&lt;p&gt;各ユニットは以下の3出力を持つ：&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;y_I, y_Q：主信号（I/Qまたは2相当成分）&lt;/li&gt;
&lt;li&gt;H_s, H_m：残差（符号付き／強度）&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;H-Carrier再注入を有効化する場合、上記 1〜3 の条件を満たすこと。&lt;br&gt;
満たさない場合、Hは「観測専用（診断ポート）」として扱う。&lt;/p&gt;




&lt;h3&gt;
  
  
  用語（短縮）
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;H（heat）：残差/排熱。単なる損失ではなく、未整定成分の情報キャリア。&lt;/li&gt;
&lt;li&gt;H-Carrier：Hを次段・次ステップのバイアスとして運ぶ仕組み。&lt;/li&gt;
&lt;li&gt;g（gate）：有用残差のみ通すフィルタ係数。&lt;/li&gt;
&lt;li&gt;λ（leak）：過去残差を忘却する係数（ドリフト防止）。&lt;/li&gt;
&lt;li&gt;α（gain）：再注入強度（ループ利得を決める）。&lt;/li&gt;
&lt;/ul&gt;

</description>
      <category>algorithms</category>
      <category>architecture</category>
      <category>computerscience</category>
      <category>systemdesign</category>
    </item>
    <item>
      <title>B13 Processor – Residual-to-Bias Feedback with Stability Constraints (Work in Progress)</title>
      <dc:creator>MORC</dc:creator>
      <pubDate>Wed, 25 Feb 2026 11:00:41 +0000</pubDate>
      <link>https://dev.to/morc_b13/b13-processor-residual-to-bias-feedback-with-stability-constraints-work-in-progress-31pa</link>
      <guid>https://dev.to/morc_b13/b13-processor-residual-to-bias-feedback-with-stability-constraints-work-in-progress-31pa</guid>
      <description>&lt;h1&gt;
  
  
  B13 Processor – Residual-to-Bias Feedback with Stability Constraints (Work in Progress)
&lt;/h1&gt;

&lt;h2&gt;
  
  
  Abstract
&lt;/h2&gt;

&lt;p&gt;This note describes an experimental architectural concept called the &lt;strong&gt;B13 Processor&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;Unlike classical FFT-based processing, which performs linear basis decomposition,&lt;br&gt;&lt;br&gt;
the B13 architecture treats internal residual energy ("heat", H) not as waste,&lt;br&gt;&lt;br&gt;
but as a structured control signal.&lt;/p&gt;

&lt;p&gt;This document focuses on one specific mechanism:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Error-to-Bias Feedback (H-Carrier)&lt;/strong&gt;&lt;br&gt;&lt;br&gt;
with explicit stability constraints.&lt;/p&gt;

&lt;p&gt;This is an engineering-oriented draft (Ver 0.9).&lt;/p&gt;




&lt;h2&gt;
  
  
  1. Motivation
&lt;/h2&gt;

&lt;p&gt;In most signal processing pipelines:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Residual error is discarded.&lt;/li&gt;
&lt;li&gt;Noise is suppressed or filtered out.&lt;/li&gt;
&lt;li&gt;Adaptation requires explicit learning.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The B13 approach proposes a different viewpoint:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Residual energy (H) may contain unresolved structural information.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Instead of discarding it,&lt;br&gt;&lt;br&gt;
we convert it into a bounded adaptive bias for the next stage.&lt;/p&gt;




&lt;h2&gt;
  
  
  2. H-Carrier Concept
&lt;/h2&gt;

&lt;p&gt;Each unit produces:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Primary signal outputs (I/Q or equivalent)&lt;/li&gt;
&lt;li&gt;Residual outputs:

&lt;ul&gt;
&lt;li&gt;H_s (signed residual)&lt;/li&gt;
&lt;li&gt;H_m (residual magnitude)&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;

&lt;/ul&gt;

&lt;p&gt;The residual is processed through:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Threshold gating&lt;/li&gt;
&lt;li&gt;Leaky integration&lt;/li&gt;
&lt;li&gt;Loop-gain constraint&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Only after satisfying these conditions is it reinjected.&lt;/p&gt;




&lt;h2&gt;
  
  
  3. Stability Constraints
&lt;/h2&gt;

&lt;h3&gt;
  
  
  3.1 Threshold Gate
&lt;/h3&gt;

&lt;p&gt;Small residuals (noise floor level) must not circulate.&lt;/p&gt;

&lt;p&gt;Let:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;τ = noise floor threshold&lt;/li&gt;
&lt;li&gt;κ = soft-gate slope&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Gate coefficient:&lt;/p&gt;

</description>
      <category>ai</category>
      <category>python</category>
      <category>opensource</category>
      <category>architecture</category>
    </item>
    <item>
      <title>Filling the 30-Second GPS Blind Spot with Balanced Quinary</title>
      <dc:creator>MORC</dc:creator>
      <pubDate>Wed, 25 Feb 2026 05:28:56 +0000</pubDate>
      <link>https://dev.to/morc_b13/filling-the-30-second-gps-blind-spot-with-balanced-quinary-430o</link>
      <guid>https://dev.to/morc_b13/filling-the-30-second-gps-blind-spot-with-balanced-quinary-430o</guid>
      <description>&lt;h3&gt;
  
  
  Core Implementation (Python)
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="n"&gt;numpy&lt;/span&gt; &lt;span class="k"&gt;as&lt;/span&gt; &lt;span class="n"&gt;np&lt;/span&gt;

&lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;to_balanced_quinary&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;value&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;unit&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="mf"&gt;0.5&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt;
    &lt;span class="n"&gt;raw&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;value&lt;/span&gt; &lt;span class="o"&gt;/&lt;/span&gt; &lt;span class="n"&gt;unit&lt;/span&gt;
    &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="nf"&gt;int&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;np&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;sign&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;raw&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="nf"&gt;min&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nf"&gt;round&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nf"&gt;abs&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;raw&lt;/span&gt;&lt;span class="p"&gt;))))&lt;/span&gt;

&lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;bqre_dead_reckoning&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;gps_x&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;gps_y&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;accel&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;gyro&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;gps_phase&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;total&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;dt&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="mf"&gt;1.0&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;unit&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="mf"&gt;0.6&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt;
    &lt;span class="n"&gt;est_x&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;np&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;zeros&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;total&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="n"&gt;est_y&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;np&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;zeros&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;total&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="n"&gt;heading&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mf"&gt;0.0&lt;/span&gt;

    &lt;span class="c1"&gt;# GPS active: use observations directly, learn heading
&lt;/span&gt;    &lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="n"&gt;t&lt;/span&gt; &lt;span class="ow"&gt;in&lt;/span&gt; &lt;span class="nf"&gt;range&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;gps_phase&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt;
        &lt;span class="n"&gt;est_x&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;t&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;gps_x&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;t&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;
        &lt;span class="n"&gt;est_y&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;t&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;gps_y&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;t&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;
        &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="n"&gt;t&lt;/span&gt; &lt;span class="o"&gt;&amp;gt;&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
            &lt;span class="n"&gt;dx&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;gps_x&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;t&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="n"&gt;gps_x&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;t&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;
            &lt;span class="n"&gt;dy&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;gps_y&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;t&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="n"&gt;gps_y&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;t&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;
            &lt;span class="n"&gt;heading&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;np&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;arctan2&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;dx&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;dy&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;

    &lt;span class="c1"&gt;# Lost: estimate using sensors + Balanced Quinary
&lt;/span&gt;    &lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="n"&gt;t&lt;/span&gt; &lt;span class="ow"&gt;in&lt;/span&gt; &lt;span class="nf"&gt;range&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;gps_phase&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;total&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt;
        &lt;span class="n"&gt;heading&lt;/span&gt; &lt;span class="o"&gt;+=&lt;/span&gt; &lt;span class="n"&gt;gyro&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;t&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="n"&gt;dt&lt;/span&gt;                             &lt;span class="c1"&gt;# update heading via gyro
&lt;/span&gt;        &lt;span class="n"&gt;speed_state&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;to_balanced_quinary&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;accel&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;t&lt;/span&gt;&lt;span class="p"&gt;],&lt;/span&gt; &lt;span class="n"&gt;unit&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;  &lt;span class="c1"&gt;# quantize acceleration
&lt;/span&gt;        &lt;span class="n"&gt;est_speed&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;speed_state&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="n"&gt;unit&lt;/span&gt;
        &lt;span class="n"&gt;est_x&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;t&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;est_x&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;t&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="n"&gt;est_speed&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="n"&gt;np&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;sin&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;heading&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="n"&gt;dt&lt;/span&gt;
        &lt;span class="n"&gt;est_y&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;t&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;est_y&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;t&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="n"&gt;est_speed&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="n"&gt;np&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;cos&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;heading&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="n"&gt;dt&lt;/span&gt;

    &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="n"&gt;est_x&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;est_y&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h2&gt;
  
  
  Simulation Experiment
&lt;/h2&gt;

&lt;h3&gt;
  
  
  Setup
&lt;/h3&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Parameter&lt;/th&gt;
&lt;th&gt;Value&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Total duration&lt;/td&gt;
&lt;td&gt;60 seconds (1 step = 1 second)&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;GPS active period&lt;/td&gt;
&lt;td&gt;0–29 seconds&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Signal lost period&lt;/td&gt;
&lt;td&gt;30–59 seconds&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;True walking speed&lt;/td&gt;
&lt;td&gt;1.2 m/s&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Heading&lt;/td&gt;
&lt;td&gt;10 degrees east of north&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;GPS observation noise&lt;/td&gt;
&lt;td&gt;Std dev 3.0 m&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Accelerometer noise&lt;/td&gt;
&lt;td&gt;Std dev 0.15 m/s²&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Gyroscope noise&lt;/td&gt;
&lt;td&gt;Std dev 2 deg/s&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Balanced Quinary unit &lt;code&gt;u&lt;/code&gt;
&lt;/td&gt;
&lt;td&gt;0.6 m/s&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;h3&gt;
  
  
  Models Compared
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Model A (conventional)&lt;/strong&gt;: Position freezes at last known GPS fix when signal is lost&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Model B (B-QRE)&lt;/strong&gt;: Balanced Quinary quantization + gyroscope-based dead reckoning&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Results
&lt;/h3&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Metric&lt;/th&gt;
&lt;th&gt;Model A (frozen)&lt;/th&gt;
&lt;th&gt;Model B (B-QRE)&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Position error after 30s loss&lt;/td&gt;
&lt;td&gt;&lt;strong&gt;27.81 m&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;&lt;strong&gt;12.69 m&lt;/strong&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Average error during loss&lt;/td&gt;
&lt;td&gt;12.04 m&lt;/td&gt;
&lt;td&gt;9.77 m&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Final error improvement&lt;/td&gt;
&lt;td&gt;—&lt;/td&gt;
&lt;td&gt;&lt;strong&gt;15.12 m reduction (≈54%)&lt;/strong&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;After 30 seconds of signal loss, Model A shows a position nearly 28 m from the true location. B-QRE stays within 13 m. For the practical use case of &lt;strong&gt;deciding which direction to walk after exiting a ticket gate&lt;/strong&gt;, this difference is meaningful.&lt;/p&gt;




&lt;h2&gt;
  
  
  Honest Limitations
&lt;/h2&gt;

&lt;p&gt;This article is a Proof of Concept. &lt;strong&gt;No real-device validation has been conducted.&lt;/strong&gt; The following points are open questions:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;unit = 0.6 m/s&lt;/code&gt; is tuned for this simulation. Real-world optimal values will vary by device and walking speed&lt;/li&gt;
&lt;li&gt;In a separate experiment, B-QRE showed no advantage over simple clipping for spike noise suppression&lt;/li&gt;
&lt;li&gt;Scenarios with frequent sharp acceleration or direction changes may be affected by the coarseness of discrete states&lt;/li&gt;
&lt;li&gt;Real-device validation requires Android GNSS Raw Measurements logs&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;The "54% improvement" figure will differ on real hardware. Please do not use this number as a basis for adoption decisions.&lt;/strong&gt;&lt;/p&gt;




&lt;h2&gt;
  
  
  What's Next
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;[ ] Validate with real Android GNSS Raw Measurements logs&lt;/li&gt;
&lt;li&gt;[ ] Dynamic adaptation of &lt;code&gt;unit&lt;/code&gt; based on movement speed&lt;/li&gt;
&lt;li&gt;[ ] Hybrid implementation with EKF&lt;/li&gt;
&lt;li&gt;[ ] Extension to 2D and 3D&lt;/li&gt;
&lt;li&gt;[ ] Evaluation in environments with frequent spike noise&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  Repository
&lt;/h2&gt;

&lt;p&gt;Full code: [GitHub — URL to be added]&lt;br&gt;&lt;br&gt;
License: MIT&lt;/p&gt;

&lt;p&gt;Feedback and pull requests are welcome.&lt;/p&gt;

</description>
      <category>algorithms</category>
      <category>computerscience</category>
      <category>programming</category>
      <category>python</category>
    </item>
  </channel>
</rss>
