<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/">
    <channel>
        <title>Juan Manuel Fernandez</title>
        <link>https://paragraph.com/@juan-manuel-fernandez</link>
        <description>*Free speech*, math, crypto &amp; health/nutrition enthusiast.

Software Development Engineer</description>
        <lastBuildDate>Mon, 07 Sep 2026 08:38:02 GMT</lastBuildDate>
        <docs>https://validator.w3.org/feed/docs/rss2.html</docs>
        <generator>https://github.com/jpmonette/feed</generator>
        <language>en</language>
        <copyright>All rights reserved</copyright>
        <item>
            <title><![CDATA[The dynamic of prime numbers]]></title>
            <link>https://paragraph.com/@juan-manuel-fernandez/the-dynamic-of-prime-numbers</link>
            <guid>70YhSWGKk4ILubuKAUIS</guid>
            <pubDate>Tue, 17 May 2022 00:41:04 GMT</pubDate>
            <description><![CDATA[A prime numbers sieve that unravels as periodic sequence of co-primes of an ever growing set of prime generator numbers that depicts the periodic distribution of prime numbers. Fourier analysis and number theory article below suggest ”the existence of some kind of mysterious dynamical system underlying (or "lurking behind" as N. Snaith put it in her Ph.D. thesis) the distribution of prime numbers.”. http://empslocal.ex.ac.uk/people/staff/mrwatkin/zeta/NTfourier.htm It’s my hope that this siev...]]></description>
            <content:encoded><![CDATA[<p>A prime numbers sieve that unravels as periodic sequence of co-primes of an ever growing set of prime <em>generator</em> numbers that depicts the periodic distribution of prime numbers.</p><p><strong>Fourier analysis and number theory</strong> article below suggest <em>”the existence of some kind of mysterious dynamical system underlying (or &quot;lurking behind&quot; as N. Snaith put it in </em><a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="http://empslocal.ex.ac.uk/people/staff/mrwatkin/zeta/snaith-thesis.ps"><em>her Ph.D. thesis</em></a><em>) the distribution of prime numbers.</em>”.</p><p><a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="http://empslocal.ex.ac.uk/people/staff/mrwatkin/zeta/NTfourier.htm">http://empslocal.ex.ac.uk/people/staff/mrwatkin/zeta/NTfourier.htm</a></p><p>It’s my hope that this sieve can prove this dynamic from the inside out as it generates the set of primes by means of <strong><em>composite periodic sequences</em></strong> of probable-primes. As the set of generator prime numbers tends to infinity so does the sequence period.</p><h2 id="h-proposition" class="text-3xl font-header !mt-8 !mb-4 first:!mt-0 first:!mb-0">Proposition</h2><p>All prime numbers (ℙ) are contained in the sequence:</p><figure float="none" data-type="figure" class="img-center" style="max-width: null;"><img src="https://storage.googleapis.com/papyrus_images/c04808bced0914b3a139da6a75fd014357be94db2b96348b2438e91cf47b3d58.png" alt="" blurdataurl="data:image/gif;base64,R0lGODlhAQABAIAAAP///wAAACwAAAAAAQABAAACAkQBADs=" nextheight="600" nextwidth="800" class="image-node embed"><figcaption HTMLAttributes="[object Object]" class="hide-figcaption"></figcaption></figure><h3 id="h-sieve-definition" class="text-2xl font-header !mt-6 !mb-4 first:!mt-0 first:!mb-0">Sieve definition</h3><figure float="none" data-type="figure" class="img-center" style="max-width: null;"><img src="https://storage.googleapis.com/papyrus_images/b8a900d8679d7fd09a94b32e807d59e2e995079e941788f732ffa7ba9394a777.png" alt="" blurdataurl="data:image/gif;base64,R0lGODlhAQABAIAAAP///wAAACwAAAAAAQABAAACAkQBADs=" nextheight="600" nextwidth="800" class="image-node embed"><figcaption HTMLAttributes="[object Object]" class="hide-figcaption"></figcaption></figure><figure float="none" data-type="figure" class="img-center" style="max-width: null;"><img src="https://storage.googleapis.com/papyrus_images/d0fd689b66cfffa745afd1e6f22bb8bcd73590a276054ef02e80ba8e161b6c4d.png" alt="" blurdataurl="data:image/gif;base64,R0lGODlhAQABAIAAAP///wAAACwAAAAAAQABAAACAkQBADs=" nextheight="600" nextwidth="800" class="image-node embed"><figcaption HTMLAttributes="[object Object]" class="hide-figcaption"></figcaption></figure><h3 id="h-initial-iterations" class="text-2xl font-header !mt-6 !mb-4 first:!mt-0 first:!mb-0">Initial iterations</h3><figure float="none" data-type="figure" class="img-center" style="max-width: null;"><img src="https://storage.googleapis.com/papyrus_images/3a0efdf80e075ace5054b53c74a2c5d2eeec98b01e3864adf16f8c3da3b4413d.png" alt="" blurdataurl="data:image/gif;base64,R0lGODlhAQABAIAAAP///wAAACwAAAAAAQABAAACAkQBADs=" nextheight="600" nextwidth="800" class="image-node embed"><figcaption HTMLAttributes="[object Object]" class="hide-figcaption"></figcaption></figure><figure float="none" data-type="figure" class="img-center" style="max-width: null;"><img src="https://storage.googleapis.com/papyrus_images/0d0136d540ffcf8c63f9a341eb7a86b3d76154511b2cff853214778a0e8a4c51.png" alt="" blurdataurl="data:image/gif;base64,R0lGODlhAQABAIAAAP///wAAACwAAAAAAQABAAACAkQBADs=" nextheight="600" nextwidth="800" class="image-node embed"><figcaption HTMLAttributes="[object Object]" class="hide-figcaption"></figcaption></figure><h2 id="h-implications" class="text-3xl font-header !mt-8 !mb-4 first:!mt-0 first:!mb-0">Implications</h2><figure float="none" data-type="figure" class="img-center" style="max-width: null;"><img src="https://storage.googleapis.com/papyrus_images/a2d6d2c6c25bea3b57c4d24b55b3466eb6528f35ba3ffb2c103c179c64e3b57e.png" alt="" blurdataurl="data:image/gif;base64,R0lGODlhAQABAIAAAP///wAAACwAAAAAAQABAAACAkQBADs=" nextheight="600" nextwidth="800" class="image-node embed"><figcaption HTMLAttributes="[object Object]" class="hide-figcaption"></figcaption></figure><h3 id="h-direct-observations-of-the-behavior-of-the-sequence-pn" class="text-2xl font-header !mt-6 !mb-4 first:!mt-0 first:!mb-0">Direct observations of the behavior of the sequence Pn</h3><figure float="none" data-type="figure" class="img-center" style="max-width: null;"><img src="https://storage.googleapis.com/papyrus_images/593d402c8f24c4125867136f94ccd5cd9c2deb787739d30f46808547dd14f529.png" alt="Table 1: n=4; Pn Gn=" blurdataurl="data:image/gif;base64,R0lGODlhAQABAIAAAP///wAAACwAAAAAAQABAAACAkQBADs=" nextheight="600" nextwidth="800" class="image-node embed"><figcaption HTMLAttributes="[object Object]" class="">Table 1: n=4; Pn Gn=</figcaption></figure><figure float="none" data-type="figure" class="img-center" style="max-width: null;"><img src="https://storage.googleapis.com/papyrus_images/72ce26a24b81517c9292a59a9cea57520ab7d8aea7c574199bc9a07126299d60.png" alt="Table 2: Tn separating last &amp; first elements in each contiguous repetition of the sequence, generating twin primes." blurdataurl="data:image/gif;base64,R0lGODlhAQABAIAAAP///wAAACwAAAAAAQABAAACAkQBADs=" nextheight="600" nextwidth="800" class="image-node embed"><figcaption HTMLAttributes="[object Object]" class="">Table 2: Tn separating last &amp; first elements in each contiguous repetition of the sequence, generating twin primes.</figcaption></figure><figure float="none" data-type="figure" class="img-center" style="max-width: null;"><img src="https://storage.googleapis.com/papyrus_images/0596b5317580b06c5ca5f43140761d9fd3a7f6fb007774e0ad1ada4b02db19a4.png" alt="Table 3: Progression of |P| &amp; Tn in relation to π(x)" blurdataurl="data:image/gif;base64,R0lGODlhAQABAIAAAP///wAAACwAAAAAAQABAAACAkQBADs=" nextheight="600" nextwidth="800" class="image-node embed"><figcaption HTMLAttributes="[object Object]" class="">Table 3: Progression of |P| &amp; Tn in relation to π(x)</figcaption></figure><p><em>Skipping</em> <code>|G|</code> <em>between 26 and 94:</em></p><figure float="none" data-type="figure" class="img-center" style="max-width: null;"><img src="https://storage.googleapis.com/papyrus_images/4aa177b068c16d5cadafe0ae7c0ed02d64581e3170df9f2a9d5e8934a7c3c7d9.png" alt="Table 4: Progression of |P| &amp; Tn in relation to π(x) |G| &gt; 94" blurdataurl="data:image/gif;base64,R0lGODlhAQABAIAAAP///wAAACwAAAAAAQABAAACAkQBADs=" nextheight="600" nextwidth="800" class="image-node embed"><figcaption HTMLAttributes="[object Object]" class="">Table 4: Progression of |P| &amp; Tn in relation to π(x) |G| &gt; 94</figcaption></figure><figure float="none" data-type="figure" class="img-center" style="max-width: null;"><img src="https://storage.googleapis.com/papyrus_images/deec9da59264b93a80f06d4a8879014267b0e28c2f06792193fa01ada6ddcfc3.jpg" alt="Image 1: Black vertical Line Tn=6; Red Tn=30; Blue Tn=210" blurdataurl="data:image/gif;base64,R0lGODlhAQABAIAAAP///wAAACwAAAAAAQABAAACAkQBADs=" nextheight="600" nextwidth="800" class="image-node embed"><figcaption HTMLAttributes="[object Object]" class="">Image 1: Black vertical Line Tn=6; Red Tn=30; Blue Tn=210</figcaption></figure><h3 id="h-" class="text-2xl font-header !mt-6 !mb-4 first:!mt-0 first:!mb-0"></h3><h2 id="h-algorithmic-approaches" class="text-3xl font-header !mt-8 !mb-4 first:!mt-0 first:!mb-0">Algorithmic approaches</h2><p>See example below. This enables us to expand <code>Pn</code> to the limits of available RAM (<em>and data structures</em>), while continue to increase accuracy of the sequence’s <em>primes locations</em> prediction for very big numbers.</p><h3 id="h-optimized-for-performance" class="text-2xl font-header !mt-6 !mb-4 first:!mt-0 first:!mb-0">Optimized for performance</h3><p>TODO.</p><h3 id="h-optimized-for-space" class="text-2xl font-header !mt-6 !mb-4 first:!mt-0 first:!mb-0">Optimized for space</h3><p>As <code>|P|</code> grows exponentially, in order to make the most use of RAM a BitMap representation is used to address as many bits as possible with the least overhead. The programing language of choice is Java and the data structure that most align with this is BitSet, <code>java.util.BitSet</code> although in it’s API it only allows for <code>int</code> values used as indexes, which limits the addresses to <code>INTEGER_MAX_VALUE</code> while the (<em>implementation dependent</em>) underlying data-store is <code>long[]</code>. In order to store the most number of bits, <code>java.util.BitSet</code> was modified to allow for <code>long</code> typed indexes, code for <code>LongBitSeg</code><a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://github.com/juanmf/LongBitSet/blob/main/LongBitSet.java"> is stored</a> under my account on github.</p><p>A basic implementation of the sieve is published on <a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://github.com/juanmf/LongBitSet/blob/main/CoprimeHarmonicsLongBitSet.java">github Here</a>. Executing <code>main()</code> method in <a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://github.com/juanmf/LongBitSet/blob/23b516edfabf22a39b4874843e4d5b1c3a8c8020/CoprimeHarmonicsLongBitSet.java">current revision</a> produces, for <code>|G| = 6</code>:</p><pre data-type="codeBlock" text=" * Computing Co-Primes Finished in 6.762224 ms. 
   With Value: 
    =&gt; |P| = 5760 ; T(P) = 30030 ; [G] = [2, 3, 5, 7, 11, 13]

 * Eliminating non-primes from [P] (except 1) Finished in 2.878282 ms. 
   With Value: 
    =&gt; Incomplete Harmonic has 
  T(iP) = 166589903787325219380851695350896256250980509594874862046961683989710 = 1.665E+69
  Allows to evaluate primality of integers in intervals [ n × T(iP) ± 30030 ]
  With Generator primes: [2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37, 41, 43, 47, 53, 59, 61, 67, 71, 73, 79, 83, 89, 97, 101, 103, 107, 109, 113, 127, 131, 137, 139, 149, 151, 157, 163, 167, 173]

 * sieveOfEratosthenes Finished in 4.354895 ms.
Primes in sieveOfEratosthenes:3248
Primes in Harmonics Sieve:    3248
"><code> <span class="hljs-operator">*</span> Computing Co<span class="hljs-operator">-</span>Primes Finished in <span class="hljs-number">6.762224</span> ms. 
   With Value: 
    <span class="hljs-operator">=</span><span class="hljs-operator">></span> <span class="hljs-operator">|</span>P<span class="hljs-operator">|</span> <span class="hljs-operator">=</span> <span class="hljs-number">5760</span> ; T(P) <span class="hljs-operator">=</span> <span class="hljs-number">30030</span> ; [G] <span class="hljs-operator">=</span> [<span class="hljs-number">2</span>, <span class="hljs-number">3</span>, <span class="hljs-number">5</span>, <span class="hljs-number">7</span>, <span class="hljs-number">11</span>, <span class="hljs-number">13</span>]

 <span class="hljs-operator">*</span> Eliminating non<span class="hljs-operator">-</span>primes <span class="hljs-keyword">from</span> [P] (except <span class="hljs-number">1</span>) Finished in <span class="hljs-number">2.878282</span> ms. 
   With Value: 
    <span class="hljs-operator">=</span><span class="hljs-operator">></span> Incomplete Harmonic has 
  T(iP) <span class="hljs-operator">=</span> <span class="hljs-number">166589903787325219380851695350896256250980509594874862046961683989710</span> <span class="hljs-operator">=</span> <span class="hljs-number">1.665E+69</span>
  Allows to evaluate primality of integers in intervals [ n × T(iP) ± <span class="hljs-number">30030</span> ]
  With Generator primes: [<span class="hljs-number">2</span>, <span class="hljs-number">3</span>, <span class="hljs-number">5</span>, <span class="hljs-number">7</span>, <span class="hljs-number">11</span>, <span class="hljs-number">13</span>, <span class="hljs-number">17</span>, <span class="hljs-number">19</span>, <span class="hljs-number">23</span>, <span class="hljs-number">29</span>, <span class="hljs-number">31</span>, <span class="hljs-number">37</span>, <span class="hljs-number">41</span>, <span class="hljs-number">43</span>, <span class="hljs-number">47</span>, <span class="hljs-number">53</span>, <span class="hljs-number">59</span>, <span class="hljs-number">61</span>, <span class="hljs-number">67</span>, <span class="hljs-number">71</span>, <span class="hljs-number">73</span>, <span class="hljs-number">79</span>, <span class="hljs-number">83</span>, <span class="hljs-number">89</span>, <span class="hljs-number">97</span>, <span class="hljs-number">101</span>, <span class="hljs-number">103</span>, <span class="hljs-number">107</span>, <span class="hljs-number">109</span>, <span class="hljs-number">113</span>, <span class="hljs-number">127</span>, <span class="hljs-number">131</span>, <span class="hljs-number">137</span>, <span class="hljs-number">139</span>, <span class="hljs-number">149</span>, <span class="hljs-number">151</span>, <span class="hljs-number">157</span>, <span class="hljs-number">163</span>, <span class="hljs-number">167</span>, <span class="hljs-number">173</span>]

 <span class="hljs-operator">*</span> sieveOfEratosthenes Finished in <span class="hljs-number">4.354895</span> ms.
Primes in sieveOfEratosthenes:<span class="hljs-number">3248</span>
Primes in Harmonics Sieve:    <span class="hljs-number">3248</span>
</code></pre><p><em>A version of sieve of Eratosthenes that also uses</em> <code>LongBitSet</code> <em>is used as precision benchmarking.</em></p><p>For <code>|G| = 10</code> (<em>current memory limit</em>), output trimmed for space:</p><pre data-type="codeBlock" text=" * Computing Co-Primes Finished in 3282.685708 ms. 
   With Value: 
    =&gt; |P| = 1021870080 ; T(P) = 6469693230 ; [G] = [2, 3, 5, 7, 11, 13, 17, 19, 23, 29]

 * Eliminating non-primes from [P] (except 1) Finished in 21541.873628 ms. 
   With Value: 
    =&gt; Incomplete Harmonic has 
  T(iP) = 28165847668170109...490685420551205570 = 2.816E+34777
  Allows to evaluate primality of integers in intervals [ n × T(iP) ± 6469693230 ]
  With Generator primes: [2, 3, 5, 7, 11, ..., 80407, 80429]

 * sieveOfEratosthenes Finished in 107445.191176 ms.
Primes in sieveOfEratosthenes:300369796
Primes in Harmonics Sieve:    300369796
"><code> <span class="hljs-operator">*</span> Computing Co<span class="hljs-operator">-</span>Primes Finished in <span class="hljs-number">3282.685708</span> ms. 
   With Value: 
    <span class="hljs-operator">=</span><span class="hljs-operator">></span> <span class="hljs-operator">|</span>P<span class="hljs-operator">|</span> <span class="hljs-operator">=</span> <span class="hljs-number">1021870080</span> ; T(P) <span class="hljs-operator">=</span> <span class="hljs-number">6469693230</span> ; [G] <span class="hljs-operator">=</span> [<span class="hljs-number">2</span>, <span class="hljs-number">3</span>, <span class="hljs-number">5</span>, <span class="hljs-number">7</span>, <span class="hljs-number">11</span>, <span class="hljs-number">13</span>, <span class="hljs-number">17</span>, <span class="hljs-number">19</span>, <span class="hljs-number">23</span>, <span class="hljs-number">29</span>]

 <span class="hljs-operator">*</span> Eliminating non<span class="hljs-operator">-</span>primes <span class="hljs-keyword">from</span> [P] (except <span class="hljs-number">1</span>) Finished in <span class="hljs-number">21541.873628</span> ms. 
   With Value: 
    <span class="hljs-operator">=</span><span class="hljs-operator">></span> Incomplete Harmonic has 
  T(iP) <span class="hljs-operator">=</span> <span class="hljs-number">28165847668170109.</span>..490685420551205570 <span class="hljs-operator">=</span> <span class="hljs-number">2.816E+34777</span>
  Allows to evaluate primality of integers in intervals [ n × T(iP) ± <span class="hljs-number">6469693230</span> ]
  With Generator primes: [<span class="hljs-number">2</span>, <span class="hljs-number">3</span>, <span class="hljs-number">5</span>, <span class="hljs-number">7</span>, <span class="hljs-number">11</span>, ..., <span class="hljs-number">80407</span>, <span class="hljs-number">80429</span>]

 <span class="hljs-operator">*</span> sieveOfEratosthenes Finished in <span class="hljs-number">107445.191176</span> ms.
Primes in sieveOfEratosthenes:<span class="hljs-number">300369796</span>
Primes in Harmonics Sieve:    <span class="hljs-number">300369796</span>
</code></pre><p>This implies that with 10 generator primes <code>[2, …, 29]</code>, we can generate an incomplete <code>Pi</code> sequence with period <code>Ti = 2.816E+34,777</code> with much more accurate prediction of probable primes than <code>Pn</code> in the vicinity of:</p><figure float="none" data-type="figure" class="img-center" style="max-width: null;"><img src="https://storage.googleapis.com/papyrus_images/38e0b9cc8033326a802647ff8c5cd944ed3e22c67a50189907481a1c332fba19.png" alt="" blurdataurl="data:image/gif;base64,R0lGODlhAQABAIAAAP///wAAACwAAAAAAQABAAACAkQBADs=" nextheight="600" nextwidth="800" class="image-node embed"><figcaption HTMLAttributes="[object Object]" class="hide-figcaption"></figcaption></figure><p><em>For an accessible (though inefficient) Javascript implementation </em><a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://jsfiddle.net/juanmf/248rnpvm/latest/"><em>see here</em></a></p><p>Update March 26th, 2025</p><p>Visualization of the sieve and contained primes up to T= 30030; G = [2, 3, 5, 7, 11, 13]</p><div data-type="youtube" videoId="M3PTaUInbeg">
      <div class="youtube-player" data-id="M3PTaUInbeg" style="background-image: url('https://i.ytimg.com/vi/M3PTaUInbeg/hqdefault.jpg'); background-size: cover; background-position: center">
        <a href="https://www.youtube.com/watch?v=M3PTaUInbeg">
          <img src="{{DOMAIN}}/editor/youtube/play.png" class="play"/>
        </a>
      </div></div><p>I recently found out about the sieve of Pritchard, or Wheel sieve, which is basically the same algorithm I came up with, but it has never been (to my knowledge) used to understand prime numbers behavior. periodicity or &quot;fractality&quot; and Implications with the most interesting aspects of the sieve: </p><p>* Twin prime locations: n<em>T+-1 (T being the primordial of generator primes, n is integer)</em> </p><p>* The gaps, grow with T, and reside by the sides of twins. i.e. n<em>T+-i (i integer &lt;= max generator)</em></p><p>* Fractal expansion. (see animation up to g=13 or T = 30,030 ) The animation shows the periodic pattern expanding in the x axis until previous to last two iterations. Then the last two expansions are done vertically for digestibility. </p><p>* Grey shows composite or removed generator prime </p><p>* Half and half shows removed multiple of newly selected generator prime. </p><p>* Blue is part of the periodic pattern. </p><p>* Red is prime, also included in the pattern (some blue change to red after primality test). </p><p>* To show fractal nature of expansion I boxed each iteration in a square of black borders.   </p><p>You can clearly see the barcode shape that forms, the fractal nature of the pattern, the twins and the growing gaps.</p>]]></content:encoded>
            <author>juan-manuel-fernandez@newsletter.paragraph.com (Juan Manuel Fernandez)</author>
            <enclosure url="https://storage.googleapis.com/papyrus_images/ac139d19ff8fa2b1aad3d3b1a06af4ffbd411a271c887fd11cd1ec3fe0b91f7c.jpg" length="0" type="image/jpg"/>
        </item>
    </channel>
</rss>