<?xml version="1.0" encoding="UTF-8"?><!DOCTYPE article PUBLIC "-//NLM//DTD JATS (Z39.96) Journal Publishing DTD v1.2 20190208//EN" "http://jats.nlm.nih.gov/publishing/1.2/JATS-journalpublishing1.dtd"><article xmlns:mml="http://www.w3.org/1998/Math/MathML" xmlns:xlink="http://www.w3.org/1999/xlink" article-type="research-article" dtd-version="1.2" xml:lang="en">
    <front>
        <journal-meta>
            <journal-id journal-id-type="pmc">F1000Research</journal-id>
            <journal-title-group>
                <journal-title>F1000Research</journal-title>
            </journal-title-group>
            <issn pub-type="epub">2046-1402</issn>
            <publisher>
                <publisher-name>F1000 Research Limited</publisher-name>
                <publisher-loc>London, UK</publisher-loc>
            </publisher>
        </journal-meta>
        <article-meta>
            <article-id pub-id-type="doi">10.12688/f1000research.165637.1</article-id>
            <article-categories>
                <subj-group subj-group-type="heading">
                    <subject>Research Article</subject>
                </subj-group>
                <subj-group>
                    <subject>Articles</subject>
                </subj-group>
            </article-categories>
            <title-group>
                <article-title>MAXEM: A New Pseudo-Random Number Generating Algorithm with Implementation of Modulo Arithmetic, XORShift, and Entropy Modulation</article-title>
                <fn-group content-type="pub-status">
                    <fn>
                        <p>[version 1; peer review: 2 not approved]</p>
                    </fn>
                </fn-group>
            </title-group>
            <contrib-group>
                <contrib contrib-type="author" corresp="no">
                    <name>
                        <surname>Sadhukhan</surname>
                        <given-names>Ramit</given-names>
                    </name>
                    <role content-type="http://credit.niso.org/">Conceptualization</role>
                    <role content-type="http://credit.niso.org/">Data Curation</role>
                    <role content-type="http://credit.niso.org/">Formal Analysis</role>
                    <role content-type="http://credit.niso.org/">Writing &#x2013; Original Draft Preparation</role>
                    <xref ref-type="aff" rid="a1">1</xref>
                </contrib>
                <contrib contrib-type="author" corresp="yes">
                    <name>
                        <surname>Chakraborty</surname>
                        <given-names>Soubhik</given-names>
                    </name>
                    <role content-type="http://credit.niso.org/">Conceptualization</role>
                    <role content-type="http://credit.niso.org/">Supervision</role>
                    <role content-type="http://credit.niso.org/">Validation</role>
                    <role content-type="http://credit.niso.org/">Writing &#x2013; Review &amp; Editing</role>
                    <uri content-type="orcid">https://orcid.org/0000-0003-3530-9027</uri>
                    <xref ref-type="corresp" rid="c1">a</xref>
                    <xref ref-type="aff" rid="a2">2</xref>
                </contrib>
                <aff id="a1">
                    <label>1</label>Mathematics, Birla Institute of Technology, Ranchi, Jharkhand, 835215, India</aff>
                <aff id="a2">
                    <label>2</label>Mathematics, Birla Institute of Technology, Ranchi, Jharkhand, 835215, India</aff>
            </contrib-group>
            <author-notes>
                <corresp id="c1">
                    <label>a</label>
                    <email xlink:href="mailto:soubhikc@yahoo.co.in">soubhikc@yahoo.co.in</email>
                </corresp>
                <fn fn-type="conflict">
                    <p>No competing interests were disclosed.</p>
                </fn>
            </author-notes>
            <pub-date pub-type="epub">
                <day>15</day>
                <month>7</month>
                <year>2025</year>
            </pub-date>
            <pub-date pub-type="collection">
                <year>2025</year>
            </pub-date>
            <volume>14</volume>
            <elocation-id>691</elocation-id>
            <history>
                <date date-type="accepted">
                    <day>27</day>
                    <month>6</month>
                    <year>2025</year>
                </date>
            </history>
            <permissions>
                <copyright-statement>Copyright: &#x00a9; 2025 Sadhukhan R and Chakraborty S</copyright-statement>
                <copyright-year>2025</copyright-year>
                <license xlink:href="https://creativecommons.org/licenses/by/4.0/">
                    <license-p>This is an open access article distributed under the terms of the Creative Commons Attribution Licence, which permits unrestricted use, distribution, and reproduction in any medium, provided the original work is properly cited.</license-p>
                </license>
            </permissions>
            <self-uri content-type="pdf" xlink:href="https://f1000research.com/articles/14-691/pdf"/>
            <abstract>
                <p>This paper introduces a novel pseudo-random number generation algorithm incorporating modulo arithmetic, XORShift, and entropy modulation. The method is designed to enhance randomness and unpredictability by utilizing bitwise manipulations and dynamic entropy modulation. Experimental results demonstrate the algorithm&#x2019;s performance across various test sets. The algorithm seeks to resolve two of the most common problems of common PRNGs, which are the quality of randomness with selection of an arbitrary seed and the presence of periodic cycles. The findings suggest potential applications in cryptography and statistical simulations.</p>
            </abstract>
            <kwd-group kwd-group-type="author">
                <kwd>Keywords: pseudo-random numbers</kwd>
                <kwd>PRNG</kwd>
                <kwd>MAXEM</kwd>
                <kwd>random number generator</kwd>
                <kwd>run test for randomness &#13;
Mathematics subject classification: 62P99</kwd>
            </kwd-group>
            <funding-group>
                <funding-statement>The author(s) declared that no grants were involved in supporting this work.</funding-statement>
            </funding-group>
        </article-meta>
    </front>
    <body>
        <sec id="sec1" sec-type="intro">
            <title>Introduction</title>
            <p>By the law of statistical regularity, a sample can be thought of as a good representation of the population only when it is selected randomly.
                <sup>
                    <xref ref-type="bibr" rid="ref1">1</xref>
                </sup> The significance of randomness in sampling lies at the heart of various applications in statistics, computer science, and cryptography. Pseudo-random number generators (PRNGs) serve as a crucial tool in generating sequences of numbers that approximate the properties of random samples, enabling robust simulations and analyses across diverse fields.</p>
            <p>Donald Knuth, in his work, The Art of Computer Programming,
                <sup>
                    <xref ref-type="bibr" rid="ref2">2</xref>
                </sup> emphasizes the significance of pseudo-random number generators (PRNGs) in computational processes. PRNGs are essential for simulating randomness in algorithms, particularly in areas such as cryptography, statistical sampling, and simulations. Their efficiency and unpredictability are crucial for ensuring that algorithms perform effectively under varied conditions and for testing hypotheses under controlled &#x201c;random&#x201d; scenarios.</p>
            <p>A lot of research has been carried out to come up with efficient and reliable PRNGs has led to numerous advancements over the years. Traditional algorithms, such as the Linear Congruential Generator (LCG), are straightforward to implement and exhibit constant-time performance. However, they often fall short in terms of statistical quality and unpredictability, leading to correlations that can skew results.
                <sup>
                    <xref ref-type="bibr" rid="ref2">2</xref>
                </sup> On the other hand, the Mersenne Twister, introduced by Matsumoto and Nishimura,
                <sup>
                    <xref ref-type="bibr" rid="ref3">3</xref>
                </sup> boasts a remarkable period and strong equidistribution properties, making it a popular choice for various applications despite its relative complexity. Recent advancements in the cryptographic applications of PRNGs emphasize the role of secure random number generators in preventing vulnerabilities like side-channel attacks.
                <sup>
                    <xref ref-type="bibr" rid="ref4">4</xref>
                </sup>
            </p>
            <p>In a more recent context, the second author has significantly advanced the understanding of randomness through his research. In a prior paper &#x201c;On Why and What of Randomness,&#x201d;
                <sup>
                    <xref ref-type="bibr" rid="ref5">5</xref>
                </sup> he explores the fundamental nature and necessity of randomness in various computational processes. His work emphasizes how randomness is not only vital for ensuring unpredictability in algorithms but also for enhancing the overall reliability of systems that depend on random number generation. By addressing the characteristics and sources of randomness, his research highlights its importance in mitigating risks associated with predictability and biases in computational settings.</p>
            <p>This paper proposes a novel PRNG algorithm that utilizes modular arithmetic, bitwise operations, and an innovative approach to entropy modulation. By incorporating prime-based entropy, this algorithm aims to enhance unpredictability and reduce periodic cycle formation. The algorithm incorporates techniques of 
                <bold>M</bold>odulo 
                <bold>A</bold>rithmetic, 
                <bold>X</bold>ORShift and 
                <bold>E</bold>ntropy 
                <bold>M</bold>odulation, and is thus called MAXEM.</p>
        </sec>
        <sec id="sec2">
            <title>Methodology</title>
            <p>In the domain of random number generators by the means of algorithms, also called Pseudo-Random Number Generators (PRNGs),
                <sup>
                    <xref ref-type="bibr" rid="ref2">2</xref>
                </sup> wide gaps are left within the algorithms in terms of their distributions or in the method of their generation. The MAXEM algorithm proposed hereafter works on fulfilling some of these gaps, such as negating the possibility of any periodiic cycle formation in a sequence, or having the ability to choose any arbitrary number as a seed without affecting the quality of randomness of the generated sequence.</p>
            <sec id="sec3">
                <title>Selection of a seed</title>
                <p>As observed by Berezowski,
                    <sup>
                        <xref ref-type="bibr" rid="ref6">6</xref>
                    </sup> the distribution of prime numbers exhibits chaotic behavior, making their prediction and arrangement highly non-trivial. This was the first thought for selection of a proper seed to generate a sequence of pseudo-random numbers. A seed can be selected as an arbitrary prime number whose magnitude depends on the magnitude of the random numbers that need to be generated. Therefore, we define the seed to be:
                    <disp-formula id="e1">

                        <mml:math display="block">
                            <mml:msub>
                                <mml:mi>p</mml:mi>
                                <mml:mn>0</mml:mn>
                            </mml:msub>
                            <mml:mo>=</mml:mo>
                            <mml:mtext mathvariant="italic">select</mml:mtext>
                            <mml:mo>_</mml:mo>
                            <mml:mtext mathvariant="italic">closest</mml:mtext>
                            <mml:mo>_</mml:mo>
                            <mml:mtext mathvariant="italic">next</mml:mtext>
                            <mml:mo>_</mml:mo>
                            <mml:mtext mathvariant="italic">prime</mml:mtext>
                            <mml:mrow>
                                <mml:mo stretchy="true">(</mml:mo>
                                <mml:mtext mathvariant="italic">random</mml:mtext>
                                <mml:mo>_</mml:mo>
                                <mml:mtext mathvariant="italic">integer</mml:mtext>
                                <mml:mrow>
                                    <mml:mo stretchy="true">(</mml:mo>
                                    <mml:mn>100</mml:mn>
                                    <mml:mo>,</mml:mo>
                                    <mml:mo mathvariant="italic">max</mml:mo>
                                    <mml:mrow>
                                        <mml:mo stretchy="true">(</mml:mo>
                                        <mml:mn>1000</mml:mn>
                                        <mml:mo>,</mml:mo>
                                        <mml:msup>
                                            <mml:mn>2</mml:mn>
                                            <mml:mrow>
                                                <mml:mo stretchy="true">&#x230a;</mml:mo>
                                                <mml:mfrac>
                                                    <mml:mi>m</mml:mi>
                                                    <mml:mn>4</mml:mn>
                                                </mml:mfrac>
                                                <mml:mo stretchy="true">&#x230b;</mml:mo>
                                            </mml:mrow>
                                        </mml:msup>
                                        <mml:mo stretchy="true">)</mml:mo>
                                    </mml:mrow>
                                    <mml:mo stretchy="true">)</mml:mo>
                                </mml:mrow>
                                <mml:mo stretchy="true">)</mml:mo>
                            </mml:mrow>
                        </mml:math>
</disp-formula>
                </p>
                <p>Here, 
                    <inline-formula>

                        <mml:math display="inline">
                            <mml:mi>m</mml:mi>
                        </mml:math>
</inline-formula> is the number of bits used to represent the integers in the sequence. If 
                    <inline-formula>

                        <mml:math display="inline">
                            <mml:mi>m</mml:mi>
                            <mml:mo>=</mml:mo>
                            <mml:mn>32</mml:mn>
                        </mml:math>
</inline-formula>, then the numbers in the sequence will be bounded by 
                    <inline-formula>

                        <mml:math display="inline">
                            <mml:msup>
                                <mml:mn>2</mml:mn>
                                <mml:mi>m</mml:mi>
                            </mml:msup>
                        </mml:math>
</inline-formula>, meaning they can take values between 
                    <inline-formula>

                        <mml:math display="inline">
                            <mml:mn>0</mml:mn>
                        </mml:math>
</inline-formula> and 
                    <inline-formula>

                        <mml:math display="inline">
                            <mml:msup>
                                <mml:mn>2</mml:mn>
                                <mml:mn>32</mml:mn>
                            </mml:msup>
                            <mml:mo>&#x2212;</mml:mo>
                            <mml:mn>1</mml:mn>
                        </mml:math>
</inline-formula> (for 32-bit integers). Thus, this function takes an arbitrary integer value between 100 and the maximum value between 
                    <inline-formula>

                        <mml:math display="inline">
                            <mml:msup>
                                <mml:mn>2</mml:mn>
                                <mml:mrow>
                                    <mml:mo stretchy="true">&#x230a;</mml:mo>
                                    <mml:mfrac>
                                        <mml:mi>m</mml:mi>
                                        <mml:mn>4</mml:mn>
                                    </mml:mfrac>
                                    <mml:mo stretchy="true">&#x230b;</mml:mo>
                                </mml:mrow>
                            </mml:msup>
                        </mml:math>
</inline-formula> and 1000, and chooses the closest prime number greater than that integer, which gives a wide range of prime numbers for the algorithm to choose from. We use 
                    <inline-formula>

                        <mml:math display="inline">
                            <mml:msup>
                                <mml:mn>2</mml:mn>
                                <mml:mrow>
                                    <mml:mo stretchy="true">&#x230a;</mml:mo>
                                    <mml:mfrac>
                                        <mml:mi>m</mml:mi>
                                        <mml:mn>4</mml:mn>
                                    </mml:mfrac>
                                    <mml:mo stretchy="true">&#x230b;</mml:mo>
                                </mml:mrow>
                            </mml:msup>
                        </mml:math>
</inline-formula> as an upper limit to make the initial seed comparatively lower in magnitude to the largest magnitude of random number that the algorithm can generate, as shall be discussed later.</p>
            </sec>
            <sec id="sec4">
                <title>Initial ideas</title>
                <p>The initial idea for developing this algorithm was to reduce, or, if possible, remove the repeating periodic cycles that appeared in the use of LCG (Linear Congruential Generators),
                    <sup>
                        <xref ref-type="bibr" rid="ref7">7</xref>
                    </sup> one of the most primitive algorithms to generate pseudo-random numbers. This led to the thought of using a non-constant entropy term which would oscillate between increasing and decreasing the current number that is being generated.
                    <disp-formula id="e2">

                        <mml:math display="block">
                            <mml:mi>b</mml:mi>
                            <mml:mo>=</mml:mo>
                            <mml:msup>
                                <mml:mrow>
                                    <mml:mo stretchy="true">(</mml:mo>
                                    <mml:mo>&#x2212;</mml:mo>
                                    <mml:mn>1</mml:mn>
                                    <mml:mo stretchy="true">)</mml:mo>
                                </mml:mrow>
                                <mml:mi>i</mml:mi>
                            </mml:msup>
                            <mml:mo>&#x00b7;</mml:mo>
                            <mml:mi>i</mml:mi>
                            <mml:mo>&#x00b7;</mml:mo>
                            <mml:msub>
                                <mml:mi>p</mml:mi>
                                <mml:mrow>
                                    <mml:mi>i</mml:mi>
                                    <mml:mo>&#x2212;</mml:mo>
                                    <mml:mn>1</mml:mn>
                                </mml:mrow>
                            </mml:msub>
                        </mml:math>
</disp-formula>
                </p>
                <p>Here, one would notice the presence of the term 
                    <inline-formula>

                        <mml:math display="inline">
                            <mml:msub>
                                <mml:mi>p</mml:mi>
                                <mml:mrow>
                                    <mml:mi>i</mml:mi>
                                    <mml:mo>&#x2212;</mml:mo>
                                    <mml:mn>1</mml:mn>
                                </mml:mrow>
                            </mml:msub>
                        </mml:math>
</inline-formula>, which speaks a lot about our algorithm. We do not simply discard the initial seed after generating the first term of the sequence. We keep our notion of the distribution of prime numbers being chaotic in nature,
                    <sup>
                        <xref ref-type="bibr" rid="ref6">6</xref>
                    </sup> and hence use a term 
                    <inline-formula>

                        <mml:math display="inline">
                            <mml:msub>
                                <mml:mi>p</mml:mi>
                                <mml:mi>i</mml:mi>
                            </mml:msub>
                        </mml:math>
</inline-formula> which is the next prime number after 
                    <inline-formula>

                        <mml:math display="inline">
                            <mml:msub>
                                <mml:mi>p</mml:mi>
                                <mml:mrow>
                                    <mml:mi>i</mml:mi>
                                    <mml:mo>&#x2212;</mml:mo>
                                    <mml:mn>1</mml:mn>
                                </mml:mrow>
                            </mml:msub>
                        </mml:math>
</inline-formula>. Thus, 
                    <inline-formula>

                        <mml:math display="inline">
                            <mml:msub>
                                <mml:mi>p</mml:mi>
                                <mml:mn>1</mml:mn>
                            </mml:msub>
                        </mml:math>
</inline-formula> would be the next prime number after 
                    <inline-formula>

                        <mml:math display="inline">
                            <mml:msub>
                                <mml:mi>p</mml:mi>
                                <mml:mn>0</mml:mn>
                            </mml:msub>
                        </mml:math>
</inline-formula>, 
                    <inline-formula>

                        <mml:math display="inline">
                            <mml:msub>
                                <mml:mi>p</mml:mi>
                                <mml:mn>2</mml:mn>
                            </mml:msub>
                        </mml:math>
</inline-formula> would be the next prime number after 
                    <inline-formula>

                        <mml:math display="inline">
                            <mml:msub>
                                <mml:mi>p</mml:mi>
                                <mml:mn>1</mml:mn>
                            </mml:msub>
                        </mml:math>
</inline-formula> and so on.</p>
            </sec>
            <sec id="sec5">
                <title>The multiplier</title>
                <p>This, again, is a very simple idea, inspired from LCG
                    <sup>
                        <xref ref-type="bibr" rid="ref7">7</xref>
                    </sup> where the first component of the algorithm is of the form 
                    <inline-formula>

                        <mml:math display="inline">
                            <mml:msub>
                                <mml:mi>x</mml:mi>
                                <mml:mi>i</mml:mi>
                            </mml:msub>
                            <mml:mo>=</mml:mo>
                            <mml:mi>f</mml:mi>
                            <mml:mrow>
                                <mml:mo stretchy="true">(</mml:mo>
                                <mml:msub>
                                    <mml:mi>x</mml:mi>
                                    <mml:mrow>
                                        <mml:mi>i</mml:mi>
                                        <mml:mo>&#x2212;</mml:mo>
                                        <mml:mn>1</mml:mn>
                                    </mml:mrow>
                                </mml:msub>
                                <mml:mo stretchy="true">)</mml:mo>
                            </mml:mrow>
                        </mml:math>
</inline-formula>, where the previous term is simply multiplied by a constant. We can modify it so that the term has a bit more randomness in the following way: 
                    <inline-formula>

                        <mml:math display="inline">
                            <mml:msub>
                                <mml:mi>x</mml:mi>
                                <mml:mi>i</mml:mi>
                            </mml:msub>
                            <mml:mo>=</mml:mo>
                            <mml:mi>f</mml:mi>
                            <mml:mrow>
                                <mml:mo stretchy="true">(</mml:mo>
                                <mml:msub>
                                    <mml:mi>x</mml:mi>
                                    <mml:mrow>
                                        <mml:mi>i</mml:mi>
                                        <mml:mo>&#x2212;</mml:mo>
                                        <mml:mn>1</mml:mn>
                                    </mml:mrow>
                                </mml:msub>
                                <mml:mo>,</mml:mo>
                                <mml:msub>
                                    <mml:mi>p</mml:mi>
                                    <mml:mrow>
                                        <mml:mi>i</mml:mi>
                                        <mml:mo>&#x2212;</mml:mo>
                                        <mml:mn>1</mml:mn>
                                    </mml:mrow>
                                </mml:msub>
                                <mml:mo stretchy="true">)</mml:mo>
                            </mml:mrow>
                        </mml:math>
</inline-formula>, where the function describes the multiplication of the two terms from its previous iteration.</p>
            </sec>
            <sec id="sec6">
                <title>XOR operation and Bit-Shift
</title>
                <p>It is important to mention that every term that the algorithm generates is always limited to 
                    <inline-formula>

                        <mml:math display="inline">
                            <mml:mi>m</mml:mi>
                        </mml:math>
</inline-formula> bits. This is achieved by taking a 
                    <inline-formula>

                        <mml:math display="inline">
                            <mml:mo mathvariant="italic">mod</mml:mo>
                            <mml:msup>
                                <mml:mn>2</mml:mn>
                                <mml:mi>m</mml:mi>
                            </mml:msup>
                        </mml:math>
</inline-formula> operation on every term that is generated. This gives us the advantage of limiting the number of bits to the necessary amount, 
                    <italic toggle="yes">i.e.</italic>, 
                    <inline-formula>

                        <mml:math display="inline">
                            <mml:mi>m</mml:mi>
                        </mml:math>
</inline-formula>, as per the use case. In order to add an extra layer of complexity, with the intention to further reduce the chance of periodic cycle formation in the sequence, a bit-wise shifting operation is introduced. The value of this shift itself is not predetermined and depends on a modulus of the iteration counter such that,

                    <disp-formula id="e3">

                        <mml:math display="block">
                            <mml:mtext mathvariant="italic">shift</mml:mtext>
                            <mml:mo>_</mml:mo>
                            <mml:mtext mathvariant="italic">amount</mml:mtext>
                            <mml:mo>=</mml:mo>
                            <mml:mtext mathvariant="italic">imod</mml:mtext>
                            <mml:mrow>
                                <mml:mo stretchy="true">&#x230a;</mml:mo>
                                <mml:mfrac>
                                    <mml:mi>m</mml:mi>
                                    <mml:mn>2</mml:mn>
                                </mml:mfrac>
                                <mml:mo stretchy="true">&#x230b;</mml:mo>
                            </mml:mrow>
                        </mml:math>
</disp-formula>
                </p>
                <p>This ensures that the number of bits shifted always falls in the range 
                    <inline-formula>

                        <mml:math display="inline">
                            <mml:mrow>
                                <mml:mo stretchy="true">[</mml:mo>
                                <mml:mn>0</mml:mn>
                                <mml:mo>,</mml:mo>
                                <mml:mfrac>
                                    <mml:mi>m</mml:mi>
                                    <mml:mn>2</mml:mn>
                                </mml:mfrac>
                                <mml:mo>&#x2212;</mml:mo>
                                <mml:mn>1</mml:mn>
                                <mml:mo stretchy="true">]</mml:mo>
                            </mml:mrow>
                        </mml:math>
</inline-formula>. Thus, the 
                    <inline-formula>

                        <mml:math display="inline">
                            <mml:msup>
                                <mml:mrow>
                                    <mml:mo stretchy="true">(</mml:mo>
                                    <mml:mi>i</mml:mi>
                                    <mml:mo>&#x2212;</mml:mo>
                                    <mml:mn>1</mml:mn>
                                    <mml:mo stretchy="true">)</mml:mo>
                                </mml:mrow>
                                <mml:mi mathvariant="italic">th</mml:mi>
                            </mml:msup>
                        </mml:math>
</inline-formula> term is right-shifted according to the above idea and can be represented as follows:
                    <disp-formula id="e4">

                        <mml:math display="block">
                            <mml:msub>
                                <mml:mi>x</mml:mi>
                                <mml:mrow>
                                    <mml:mi>i</mml:mi>
                                    <mml:mo>&#x2212;</mml:mo>
                                    <mml:mn>1</mml:mn>
                                </mml:mrow>
                            </mml:msub>
                            <mml:mo>&#x226b;</mml:mo>
                            <mml:mrow>
                                <mml:mo stretchy="true">(</mml:mo>
                                <mml:mtext mathvariant="italic">imod</mml:mtext>
                                <mml:mrow>
                                    <mml:mo stretchy="true">&#x230a;</mml:mo>
                                    <mml:mfrac>
                                        <mml:mi>m</mml:mi>
                                        <mml:mn>2</mml:mn>
                                    </mml:mfrac>
                                    <mml:mo stretchy="true">&#x230b;</mml:mo>
                                </mml:mrow>
                                <mml:mo stretchy="true">)</mml:mo>
                            </mml:mrow>
                            <mml:mo>&#x2261;</mml:mo>
                            <mml:mrow>
                                <mml:mo stretchy="true">(</mml:mo>
                                <mml:mfrac>
                                    <mml:msub>
                                        <mml:mi>x</mml:mi>
                                        <mml:mrow>
                                            <mml:mi>i</mml:mi>
                                            <mml:mo>&#x2212;</mml:mo>
                                            <mml:mn>1</mml:mn>
                                        </mml:mrow>
                                    </mml:msub>
                                    <mml:msup>
                                        <mml:mn>2</mml:mn>
                                        <mml:mrow>
                                            <mml:mo stretchy="true">(</mml:mo>
                                            <mml:mtext mathvariant="italic">imod</mml:mtext>
                                            <mml:mrow>
                                                <mml:mo stretchy="true">&#x230a;</mml:mo>
                                                <mml:mfrac>
                                                    <mml:mi>m</mml:mi>
                                                    <mml:mn>2</mml:mn>
                                                </mml:mfrac>
                                                <mml:mo stretchy="true">&#x230b;</mml:mo>
                                            </mml:mrow>
                                            <mml:mo stretchy="true">)</mml:mo>
                                        </mml:mrow>
                                    </mml:msup>
                                </mml:mfrac>
                                <mml:mo stretchy="true">)</mml:mo>
                            </mml:mrow>
                        </mml:math>
</disp-formula>
                </p>
                <p>Since 
                    <inline-formula>

                        <mml:math display="inline">
                            <mml:msub>
                                <mml:mi>x</mml:mi>
                                <mml:mrow>
                                    <mml:mi>i</mml:mi>
                                    <mml:mo>&#x2212;</mml:mo>
                                    <mml:mn>1</mml:mn>
                                </mml:mrow>
                            </mml:msub>
                        </mml:math>
</inline-formula> is of m bits, the term produced above is of m-bits. Again, on applying a 
                    <inline-formula>

                        <mml:math display="inline">
                            <mml:mtext mathvariant="italic">modulus</mml:mtext>
                        </mml:math>
</inline-formula> on the multiplier term, we can also guarantee it to have the same number of bits. With this knowledge, we can easily apply an &#x2018;ExclusiveOR&#x2019; or &#x2018;XOR&#x2019; operation on these two terms to get a fairly convoluted string of bits. Marsaglia stated that in the context of random number generation, the use of XOR operations has been shown to enhance the efficiency and unpredictability of pseudo-random number generators. As demonstrated by him in 2003,
                    <sup>
                        <xref ref-type="bibr" rid="ref8">8</xref>
                    </sup> XORShift random number generators utilize bit-wise XOR operations to produce sequences of numbers that exhibit desirable statistical properties, making them suitable for a variety of applications. Therefore, these operations can be combined to form the whole m-bit term as follows:
                    <disp-formula id="e5">

                        <mml:math display="block">
                            <mml:msub>
                                <mml:mi>x</mml:mi>
                                <mml:mi>i</mml:mi>
                            </mml:msub>
                            <mml:mo>=</mml:mo>
                            <mml:mrow>
                                <mml:mo stretchy="true">(</mml:mo>
                                <mml:mrow>
                                    <mml:mo stretchy="true">(</mml:mo>
                                    <mml:mi>f</mml:mi>
                                    <mml:mrow>
                                        <mml:mo stretchy="true">(</mml:mo>
                                        <mml:msub>
                                            <mml:mi>x</mml:mi>
                                            <mml:mrow>
                                                <mml:mi>i</mml:mi>
                                                <mml:mo>&#x2212;</mml:mo>
                                                <mml:mn>1</mml:mn>
                                            </mml:mrow>
                                        </mml:msub>
                                        <mml:mo>,</mml:mo>
                                        <mml:msub>
                                            <mml:mi>p</mml:mi>
                                            <mml:mrow>
                                                <mml:mi>i</mml:mi>
                                                <mml:mo>&#x2212;</mml:mo>
                                                <mml:mn>1</mml:mn>
                                            </mml:mrow>
                                        </mml:msub>
                                        <mml:mo stretchy="true">)</mml:mo>
                                    </mml:mrow>
                                    <mml:mo mathvariant="italic">mod</mml:mo>
                                    <mml:msup>
                                        <mml:mn>2</mml:mn>
                                        <mml:mi>m</mml:mi>
                                    </mml:msup>
                                    <mml:mo stretchy="true">)</mml:mo>
                                </mml:mrow>
                                <mml:mo>&#x2295;</mml:mo>
                                <mml:mrow>
                                    <mml:mo stretchy="true">(</mml:mo>
                                    <mml:mfrac>
                                        <mml:msub>
                                            <mml:mi>x</mml:mi>
                                            <mml:mrow>
                                                <mml:mi>i</mml:mi>
                                                <mml:mo>&#x2212;</mml:mo>
                                                <mml:mn>1</mml:mn>
                                            </mml:mrow>
                                        </mml:msub>
                                        <mml:msup>
                                            <mml:mn>2</mml:mn>
                                            <mml:mrow>
                                                <mml:mo stretchy="true">(</mml:mo>
                                                <mml:mtext mathvariant="italic">imod</mml:mtext>
                                                <mml:mrow>
                                                    <mml:mo stretchy="true">&#x230a;</mml:mo>
                                                    <mml:mfrac>
                                                        <mml:mi>m</mml:mi>
                                                        <mml:mn>2</mml:mn>
                                                    </mml:mfrac>
                                                    <mml:mo stretchy="true">&#x230b;</mml:mo>
                                                </mml:mrow>
                                                <mml:mo stretchy="true">)</mml:mo>
                                            </mml:mrow>
                                        </mml:msup>
                                    </mml:mfrac>
                                    <mml:mo stretchy="true">)</mml:mo>
                                </mml:mrow>
                                <mml:mo stretchy="true">)</mml:mo>
                            </mml:mrow>
                        </mml:math>
</disp-formula>
                </p>
                <p>The XOR operation is mathematically represented by the 
                    <inline-formula>

                        <mml:math display="inline">
                            <mml:mo>&#x2295;</mml:mo>
                        </mml:math>
</inline-formula> symbol.</p>
            </sec>
            <sec id="sec7">
                <title>The MAXEM algorithm</title>
                <p>The final output sequence at each step 
                    <inline-formula>

                        <mml:math display="inline">
                            <mml:mi>i</mml:mi>
                        </mml:math>
</inline-formula>, denoted by 
                    <inline-formula>

                        <mml:math display="inline">
                            <mml:msub>
                                <mml:mi>x</mml:mi>
                                <mml:mi>i</mml:mi>
                            </mml:msub>
                        </mml:math>
</inline-formula>, is generated using a combination of Modular Arithmetic, bit-wise manipulation (XORshift), and Entropy Modulation as is a culmination of the ideas discussed above and can be represented as follows:
                    <disp-formula id="e6">

                        <mml:math display="block">
                            <mml:msub>
                                <mml:mi>x</mml:mi>
                                <mml:mi>i</mml:mi>
                            </mml:msub>
                            <mml:mo>=</mml:mo>
                            <mml:mrow>
                                <mml:mo stretchy="true">(</mml:mo>
                                <mml:mrow>
                                    <mml:mo stretchy="true">(</mml:mo>
                                    <mml:mrow>
                                        <mml:mo stretchy="true">(</mml:mo>
                                        <mml:msub>
                                            <mml:mi>x</mml:mi>
                                            <mml:mrow>
                                                <mml:mi>i</mml:mi>
                                                <mml:mo>&#x2212;</mml:mo>
                                                <mml:mn>1</mml:mn>
                                            </mml:mrow>
                                        </mml:msub>
                                        <mml:mo>&#x00b7;</mml:mo>
                                        <mml:msub>
                                            <mml:mi>p</mml:mi>
                                            <mml:mrow>
                                                <mml:mi>i</mml:mi>
                                                <mml:mo>&#x2212;</mml:mo>
                                                <mml:mn>1</mml:mn>
                                            </mml:mrow>
                                        </mml:msub>
                                        <mml:mo stretchy="true">)</mml:mo>
                                    </mml:mrow>
                                    <mml:mo mathvariant="italic">mod</mml:mo>
                                    <mml:msup>
                                        <mml:mn>2</mml:mn>
                                        <mml:mi>m</mml:mi>
                                    </mml:msup>
                                    <mml:mo stretchy="true">)</mml:mo>
                                </mml:mrow>
                                <mml:mo>&#x2295;</mml:mo>
                                <mml:mrow>
                                    <mml:mo stretchy="true">(</mml:mo>
                                    <mml:mfrac>
                                        <mml:msub>
                                            <mml:mi>x</mml:mi>
                                            <mml:mrow>
                                                <mml:mi>i</mml:mi>
                                                <mml:mo>&#x2212;</mml:mo>
                                                <mml:mn>1</mml:mn>
                                            </mml:mrow>
                                        </mml:msub>
                                        <mml:msup>
                                            <mml:mn>2</mml:mn>
                                            <mml:mrow>
                                                <mml:mo stretchy="true">(</mml:mo>
                                                <mml:mtext mathvariant="italic">imod</mml:mtext>
                                                <mml:mrow>
                                                    <mml:mo stretchy="true">&#x230a;</mml:mo>
                                                    <mml:mfrac>
                                                        <mml:mi>m</mml:mi>
                                                        <mml:mn>2</mml:mn>
                                                    </mml:mfrac>
                                                    <mml:mo stretchy="true">&#x230b;</mml:mo>
                                                </mml:mrow>
                                                <mml:mo stretchy="true">)</mml:mo>
                                            </mml:mrow>
                                        </mml:msup>
                                    </mml:mfrac>
                                    <mml:mo stretchy="true">)</mml:mo>
                                </mml:mrow>
                                <mml:mo>+</mml:mo>
                                <mml:msup>
                                    <mml:mrow>
                                        <mml:mo stretchy="true">(</mml:mo>
                                        <mml:mo>&#x2212;</mml:mo>
                                        <mml:mn>1</mml:mn>
                                        <mml:mo stretchy="true">)</mml:mo>
                                    </mml:mrow>
                                    <mml:mi>i</mml:mi>
                                </mml:msup>
                                <mml:mo>&#x00b7;</mml:mo>
                                <mml:mi>i</mml:mi>
                                <mml:mo>&#x00b7;</mml:mo>
                                <mml:msub>
                                    <mml:mi>p</mml:mi>
                                    <mml:mrow>
                                        <mml:mi>i</mml:mi>
                                        <mml:mo>&#x2212;</mml:mo>
                                        <mml:mn>1</mml:mn>
                                    </mml:mrow>
                                </mml:msub>
                                <mml:mo stretchy="true">)</mml:mo>
                            </mml:mrow>
                            <mml:mo mathvariant="italic">mod</mml:mo>
                            <mml:msup>
                                <mml:mn>2</mml:mn>
                                <mml:mi>m</mml:mi>
                            </mml:msup>
                        </mml:math>
</disp-formula>
                </p>
                <p>Where:
                    <list list-type="bullet">
                        <list-item>
                            <label>&#x2022;</label>
                            <p>

                                <inline-formula>

                                    <mml:math display="inline">
                                        <mml:mi>i</mml:mi>
                                    </mml:math>
</inline-formula> denotes the iteration counter,</p>
                        </list-item>
                        <list-item>
                            <label>&#x2022;</label>
                            <p>

                                <inline-formula>

                                    <mml:math display="inline">
                                        <mml:msub>
                                            <mml:mi>x</mml:mi>
                                            <mml:mrow>
                                                <mml:mi>i</mml:mi>
                                                <mml:mo>&#x2212;</mml:mo>
                                                <mml:mn>1</mml:mn>
                                            </mml:mrow>
                                        </mml:msub>
                                    </mml:math>
</inline-formula> is the previous number in the sequence, 
                                <italic toggle="yes">i.e.</italic>, the term generated at iteration 
                                <inline-formula>

                                    <mml:math display="inline">
                                        <mml:mi>i</mml:mi>
                                        <mml:mo>&#x2212;</mml:mo>
                                        <mml:mn>1</mml:mn>
                                    </mml:math>
</inline-formula>,</p>
                        </list-item>
                        <list-item>
                            <label>&#x2022;</label>
                            <p>

                                <inline-formula>

                                    <mml:math display="inline">
                                        <mml:msub>
                                            <mml:mi>p</mml:mi>
                                            <mml:mrow>
                                                <mml:mi>i</mml:mi>
                                                <mml:mo>&#x2212;</mml:mo>
                                                <mml:mn>1</mml:mn>
                                            </mml:mrow>
                                        </mml:msub>
                                    </mml:math>
</inline-formula> is the prime seed at iteration 
                                <inline-formula>

                                    <mml:math display="inline">
                                        <mml:mi>i</mml:mi>
                                        <mml:mo>&#x2212;</mml:mo>
                                        <mml:mn>1</mml:mn>
                                    </mml:math>
</inline-formula>,</p>
                        </list-item>
                        <list-item>
                            <label>&#x2022;</label>
                            <p>

                                <inline-formula>

                                    <mml:math display="inline">
                                        <mml:mo>&#x2295;</mml:mo>
                                    </mml:math>
</inline-formula> denotes the bitwise XOR operation,</p>
                        </list-item>
                        <list-item>
                            <label>&#x2022;</label>
                            <p>

                                <inline-formula>

                                    <mml:math display="inline">
                                        <mml:mo mathvariant="italic">mod</mml:mo>
                                        <mml:msup>
                                            <mml:mn>2</mml:mn>
                                            <mml:mi>m</mml:mi>
                                        </mml:msup>
                                    </mml:math>
</inline-formula> ensures the number stays within an 
                                <inline-formula>

                                    <mml:math display="inline">
                                        <mml:mi>m</mml:mi>
                                    </mml:math>
</inline-formula>-bit range,</p>
                        </list-item>
                        <list-item>
                            <label>&#x2022;</label>
                            <p>

                                <inline-formula>

                                    <mml:math display="inline">
                                        <mml:mfrac>
                                            <mml:msub>
                                                <mml:mi>x</mml:mi>
                                                <mml:mrow>
                                                    <mml:mi>i</mml:mi>
                                                    <mml:mo>&#x2212;</mml:mo>
                                                    <mml:mn>1</mml:mn>
                                                </mml:mrow>
                                            </mml:msub>
                                            <mml:msup>
                                                <mml:mn>2</mml:mn>
                                                <mml:mrow>
                                                    <mml:mo stretchy="true">(</mml:mo>
                                                    <mml:mtext mathvariant="italic">imod</mml:mtext>
                                                    <mml:mrow>
                                                        <mml:mo stretchy="true">(</mml:mo>
                                                        <mml:mi>m</mml:mi>
                                                        <mml:mo>&#x2212;</mml:mo>
                                                        <mml:mn>1</mml:mn>
                                                        <mml:mo stretchy="true">)</mml:mo>
                                                    </mml:mrow>
                                                    <mml:mo stretchy="true">)</mml:mo>
                                                </mml:mrow>
                                            </mml:msup>
                                        </mml:mfrac>
                                    </mml:math>
</inline-formula> is a bitwise shift operation,</p>
                        </list-item>
                        <list-item>
                            <label>&#x2022;</label>
                            <p>

                                <inline-formula>

                                    <mml:math display="inline">
                                        <mml:msup>
                                            <mml:mrow>
                                                <mml:mo stretchy="true">(</mml:mo>
                                                <mml:mo>&#x2212;</mml:mo>
                                                <mml:mn>1</mml:mn>
                                                <mml:mo stretchy="true">)</mml:mo>
                                            </mml:mrow>
                                            <mml:mi>i</mml:mi>
                                        </mml:msup>
                                    </mml:math>
</inline-formula> introduces alternating addition and subtraction to the entropy term,</p>
                        </list-item>
                        <list-item>
                            <label>&#x2022;</label>
                            <p>

                                <inline-formula>

                                    <mml:math display="inline">
                                        <mml:mi>i</mml:mi>
                                        <mml:mo>&#x00b7;</mml:mo>
                                        <mml:msub>
                                            <mml:mi>p</mml:mi>
                                            <mml:mrow>
                                                <mml:mi>i</mml:mi>
                                                <mml:mo>&#x2212;</mml:mo>
                                                <mml:mn>1</mml:mn>
                                            </mml:mrow>
                                        </mml:msub>
                                    </mml:math>
</inline-formula> adds entropy based on the iteration and prime seed.</p>
                        </list-item>
                    </list>
                </p>
                <p>The algorithm for this can be given as follows:</p>
                <p>

                    <monospace>seed</monospace> 
                    <inline-formula>

                        <mml:math display="inline">
                            <mml:mo>&#x2190;</mml:mo>
                        </mml:math>
</inline-formula> next prime from random number in range 
                    <inline-formula>

                        <mml:math display="inline">
                            <mml:mrow>
                                <mml:mo stretchy="true">[</mml:mo>
                                <mml:mn>100</mml:mn>
                                <mml:mo>,</mml:mo>
                                <mml:mo mathvariant="italic">max</mml:mo>
                                <mml:mrow>
                                    <mml:mo stretchy="true">(</mml:mo>
                                    <mml:mn>1000</mml:mn>
                                    <mml:mo>,</mml:mo>
                                    <mml:msup>
                                        <mml:mn>2</mml:mn>
                                        <mml:mfrac>
                                            <mml:mi>m</mml:mi>
                                            <mml:mn>4</mml:mn>
                                        </mml:mfrac>
                                    </mml:msup>
                                    <mml:mo stretchy="true">)</mml:mo>
                                </mml:mrow>
                                <mml:mo stretchy="true">]</mml:mo>
                            </mml:mrow>
                        </mml:math>
</inline-formula> Initialize 
                    <monospace>sequence</monospace> as an empty list 
                    <monospace>current</monospace> 
                    <inline-formula>

                        <mml:math display="inline">
                            <mml:mo>&#x2190;</mml:mo>
                        </mml:math>
</inline-formula> 
                    <monospace>seed</monospace>
                </p>
                <p>

                    <monospace>next_num</monospace> 
                    <inline-formula>

                        <mml:math display="inline">
                            <mml:mo>&#x2190;</mml:mo>
                        </mml:math>
</inline-formula> (
                    <monospace>current</monospace> 
                    <inline-formula>

                        <mml:math display="inline">
                            <mml:mo>&#x00d7;</mml:mo>
                        </mml:math>
</inline-formula> 
                    <monospace>seed</monospace>) 
                    <inline-formula>

                        <mml:math display="inline">
                            <mml:mo mathvariant="italic">mod</mml:mo>
                            <mml:msup>
                                <mml:mn>2</mml:mn>
                                <mml:mi>m</mml:mi>
                            </mml:msup>
                        </mml:math>
</inline-formula> 
                    <monospace>next_num</monospace> 
                    <inline-formula>

                        <mml:math display="inline">
                            <mml:mo>&#x2190;</mml:mo>
                        </mml:math>
</inline-formula> 
                    <monospace>next_num</monospace> 
                    <inline-formula>

                        <mml:math display="inline">
                            <mml:mo>&#x2295;</mml:mo>
                        </mml:math>
</inline-formula> (
                    <monospace>current</monospace> 
                    <inline-formula>

                        <mml:math display="inline">
                            <mml:mo>&#x226b;</mml:mo>
                            <mml:mrow>
                                <mml:mo stretchy="true">(</mml:mo>
                                <mml:mtext mathvariant="italic">imod</mml:mtext>
                                <mml:mfrac>
                                    <mml:mi>m</mml:mi>
                                    <mml:mn>2</mml:mn>
                                </mml:mfrac>
                                <mml:mo stretchy="true">)</mml:mo>
                            </mml:mrow>
                            <mml:mo stretchy="true">)</mml:mo>
                        </mml:math>
</inline-formula> 
                    <monospace>next_num</monospace> 
                    <inline-formula>

                        <mml:math display="inline">
                            <mml:mo>&#x2190;</mml:mo>
                        </mml:math>
</inline-formula> (
                    <monospace>next_num</monospace> + 
                    <inline-formula>

                        <mml:math display="inline">
                            <mml:msup>
                                <mml:mrow>
                                    <mml:mo stretchy="true">(</mml:mo>
                                    <mml:mo>&#x2212;</mml:mo>
                                    <mml:mn>1</mml:mn>
                                    <mml:mo stretchy="true">)</mml:mo>
                                </mml:mrow>
                                <mml:mi>i</mml:mi>
                            </mml:msup>
                            <mml:mo>&#x00d7;</mml:mo>
                            <mml:mi>i</mml:mi>
                            <mml:mo>&#x00d7;</mml:mo>
                            <mml:mtext mathvariant="italic">seed</mml:mtext>
                        </mml:math>
</inline-formula>) 
                    <inline-formula>

                        <mml:math display="inline">
                            <mml:mo mathvariant="italic">mod</mml:mo>
                            <mml:msup>
                                <mml:mn>2</mml:mn>
                                <mml:mi>m</mml:mi>
                            </mml:msup>
                        </mml:math>
</inline-formula> Append 
                    <monospace>next_num</monospace> to 
                    <monospace>sequence seed</monospace> 
                    <inline-formula>

                        <mml:math display="inline">
                            <mml:mo>&#x2190;</mml:mo>
                        </mml:math>
</inline-formula> next prime after 
                    <monospace>seed current</monospace> 
                    <inline-formula>

                        <mml:math display="inline">
                            <mml:mo>&#x2190;</mml:mo>
                        </mml:math>
</inline-formula> 
                    <monospace>next_num</monospace>
                </p>
                <p>

                    <bold>return</bold> 
                    <monospace>sequence</monospace>
                </p>
            </sec>
        </sec>
        <sec id="sec8">
            <title>Running the algorithm for an example test case</title>
            <p>Python language
                <sup>
                    <xref ref-type="bibr" rid="ref9">9</xref>
                </sup> was used to code this algorithm due to the simplicity of the language and the wide range of libraries suited for scientific computing. Additionally, Google Colab, which has proven to be a valuable platform for running Python code in a cloud environment in the form of notebooks, enabling easy collaboration and access to powerful computational resources without the need for local hardware,
                <sup>
                    <xref ref-type="bibr" rid="ref10">10</xref>
                </sup> was used as the primary development environment. The allocated runtime came with a system RAM of 12.7 GB, a disk memory of 107.7 GB and no dedicated memory for graphics processing. In this section, we discuss a test run of the above algorithm with the following parameters:
                <disp-formula id="e7">

                    <mml:math display="block">
                        <mml:mi mathvariant="normal">n</mml:mi>
                        <mml:mo>=</mml:mo>
                        <mml:mn>1000000</mml:mn>
                        <mml:mo>;</mml:mo>
                        <mml:mi mathvariant="normal">m</mml:mi>
                        <mml:mo>=</mml:mo>
                        <mml:mn>128</mml:mn>
                    </mml:math>
</disp-formula>
            </p>
            <p>
                <xref ref-type="fig" rid="f1">
Figure 1</xref> shows the distribution of random numbers generated as a scatter plot with the index values of the random number sequence on the x-axis and the value of the random numbers on the y-axis. It is quite evident that this scatter plot shows a discrete uniform distribution of random numbers in the range 
                <inline-formula>

                    <mml:math display="inline">
                        <mml:mn>0</mml:mn>
                        <mml:mspace width="0.25em"/>
                        <mml:mtext>to</mml:mtext>
                        <mml:mspace width="0.25em"/>
                        <mml:msup>
                            <mml:mn>2</mml:mn>
                            <mml:mi>m</mml:mi>
                        </mml:msup>
                    </mml:math>
</inline-formula>, given, 
                <inline-formula>

                    <mml:math display="inline">
                        <mml:msup>
                            <mml:mn>2</mml:mn>
                            <mml:mi>m</mml:mi>
                        </mml:msup>
                        <mml:mspace width="0.25em"/>
                        <mml:mo>&#x2248;</mml:mo>
                        <mml:mspace width="0.25em"/>
                        <mml:mn>3.402</mml:mn>
                        <mml:mo>&#x00d7;</mml:mo>
                        <mml:msup>
                            <mml:mn>10</mml:mn>
                            <mml:mn>38</mml:mn>
                        </mml:msup>
                    </mml:math>
</inline-formula>.</p>
            <fig fig-type="figure" id="f1" orientation="portrait" position="float">
                <label>
Figure 1. </label>
                <caption>
                    <title>Plot showing uniformly distributed random numbers of the MAXEM Algorithm.</title>
                </caption>
                <graphic id="gr1" orientation="portrait" position="float" xlink:href="https://f1000research-files.f1000.com/manuscripts/182325/8ff7d115-1d44-45b5-904a-e0db9017318b_figure1.gif"/>
            </fig>
            <p>The mean, variance, standard deviation, median, minimum, maximum, and range of the generated numbers are summarized in 
                <xref ref-type="table" rid="T1">
Table 1</xref>.</p>
            <table-wrap id="T1" orientation="portrait" position="float">
                <label>
Table 1. </label>
                <caption>
                    <title>Descriptive statistics of generated random numbers.</title>
                </caption>
                <table content-type="article-table" frame="hsides">
                    <thead>
                        <tr>
                            <th align="left" colspan="1" rowspan="1" valign="top">Statistic</th>
                            <th align="left" colspan="1" rowspan="1" valign="top">
Value</th>
                        </tr>
                    </thead>
                    <tbody>
                        <tr>
                            <td align="left" colspan="1" rowspan="1" valign="top">Mean</td>
                            <td align="left" colspan="1" rowspan="1" valign="top">
                                <inline-formula>

                                    <mml:math display="inline">
                                        <mml:mn>1.700836445315122</mml:mn>
                                        <mml:mo>&#x00d7;</mml:mo>
                                        <mml:msup>
                                            <mml:mn>10</mml:mn>
                                            <mml:mn>38</mml:mn>
                                        </mml:msup>
                                    </mml:math>
</inline-formula>
</td>
                        </tr>
                        <tr>
                            <td align="left" colspan="1" rowspan="1" valign="top">Error in Mean</td>
                            <td align="left" colspan="1" rowspan="1" valign="top">
                                <inline-formula>

                                    <mml:math display="inline">
                                        <mml:mo>&#x2212;</mml:mo>
                                        <mml:mn>0.03381834297068176</mml:mn>
                                        <mml:mo>%</mml:mo>
                                    </mml:math>
</inline-formula>
</td>
                        </tr>
                        <tr>
                            <td align="left" colspan="1" rowspan="1" valign="top">Variance</td>
                            <td align="left" colspan="1" rowspan="1" valign="top">
                                <inline-formula>

                                    <mml:math display="inline">
                                        <mml:mn>9.662277875992937</mml:mn>
                                        <mml:mo>&#x00d7;</mml:mo>
                                        <mml:msup>
                                            <mml:mn>10</mml:mn>
                                            <mml:mn>75</mml:mn>
                                        </mml:msup>
                                    </mml:math>
</inline-formula>
</td>
                        </tr>
                        <tr>
                            <td align="left" colspan="1" rowspan="1" valign="top">Standard Deviation</td>
                            <td align="left" colspan="1" rowspan="1" valign="top">
                                <inline-formula>

                                    <mml:math display="inline">
                                        <mml:mn>9.829688640029723</mml:mn>
                                        <mml:mo>&#x00d7;</mml:mo>
                                        <mml:msup>
                                            <mml:mn>10</mml:mn>
                                            <mml:mn>37</mml:mn>
                                        </mml:msup>
                                    </mml:math>
</inline-formula>
</td>
                        </tr>
                        <tr>
                            <td align="left" colspan="1" rowspan="1" valign="top">Median</td>
                            <td align="left" colspan="1" rowspan="1" valign="top">
                                <inline-formula>

                                    <mml:math display="inline">
                                        <mml:mn>1.7003589590683976</mml:mn>
                                        <mml:mo>&#x00d7;</mml:mo>
                                        <mml:msup>
                                            <mml:mn>10</mml:mn>
                                            <mml:mn>38</mml:mn>
                                        </mml:msup>
                                    </mml:math>
</inline-formula>
</td>
                        </tr>
                        <tr>
                            <td align="left" colspan="1" rowspan="1" valign="top">Minimum</td>
                            <td align="left" colspan="1" rowspan="1" valign="top">
                                <inline-formula>

                                    <mml:math display="inline">
                                        <mml:mn>6850768168405461780</mml:mn>
                                    </mml:math>
</inline-formula>
</td>
                        </tr>
                        <tr>
                            <td align="left" colspan="1" rowspan="1" valign="top">Maximum</td>
                            <td align="left" colspan="1" rowspan="1" valign="top">
                                <inline-formula>

                                    <mml:math display="inline">
                                        <mml:mn>3.402823437297518</mml:mn>
                                        <mml:mo>&#x00d7;</mml:mo>
                                        <mml:msup>
                                            <mml:mn>10</mml:mn>
                                            <mml:mn>38</mml:mn>
                                        </mml:msup>
                                    </mml:math>
</inline-formula>
</td>
                        </tr>
                        <tr>
                            <td align="left" colspan="1" rowspan="1" valign="top">Range</td>
                            <td align="left" colspan="1" rowspan="1" valign="top">
                                <inline-formula>

                                    <mml:math display="inline">
                                        <mml:mn>3.402823437297518</mml:mn>
                                        <mml:mo>&#x00d7;</mml:mo>
                                        <mml:msup>
                                            <mml:mn>10</mml:mn>
                                            <mml:mn>38</mml:mn>
                                        </mml:msup>
                                    </mml:math>
</inline-formula>
</td>
                        </tr>
                        <tr>
                            <td align="left" colspan="1" rowspan="1" valign="top">25th Percentile</td>
                            <td align="left" colspan="1" rowspan="1" valign="top">
                                <inline-formula>

                                    <mml:math display="inline">
                                        <mml:mn>8.495850037229687</mml:mn>
                                        <mml:mo>&#x00d7;</mml:mo>
                                        <mml:msup>
                                            <mml:mn>10</mml:mn>
                                            <mml:mn>37</mml:mn>
                                        </mml:msup>
                                    </mml:math>
</inline-formula>
</td>
                        </tr>
                        <tr>
                            <td align="left" colspan="1" rowspan="1" valign="top">75th Percentile</td>
                            <td align="left" colspan="1" rowspan="1" valign="top">
                                <inline-formula>

                                    <mml:math display="inline">
                                        <mml:mn>2.5531358993801777</mml:mn>
                                        <mml:mo>&#x00d7;</mml:mo>
                                        <mml:msup>
                                            <mml:mn>10</mml:mn>
                                            <mml:mn>38</mml:mn>
                                        </mml:msup>
                                    </mml:math>
</inline-formula>
</td>
                        </tr>
                        <tr>
                            <td align="left" colspan="1" rowspan="1" valign="top">Interquartile Range (IQR)</td>
                            <td align="left" colspan="1" rowspan="1" valign="top">
                                <inline-formula>

                                    <mml:math display="inline">
                                        <mml:mn>1.703550895657209</mml:mn>
                                        <mml:mo>&#x00d7;</mml:mo>
                                        <mml:msup>
                                            <mml:mn>10</mml:mn>
                                            <mml:mn>38</mml:mn>
                                        </mml:msup>
                                    </mml:math>
</inline-formula>
</td>
                        </tr>
                    </tbody>
                </table>
            </table-wrap>
            <p>The population mean of a discrete uniform distribution can be calculated using the formula:
                <disp-formula id="e8">

                    <mml:math display="block">
                        <mml:mover>
                            <mml:mi>x</mml:mi>
                            <mml:mo>&#x00af;</mml:mo>
                        </mml:mover>
                        <mml:mo>=</mml:mo>
                        <mml:mfrac>
                            <mml:mrow>
                                <mml:mi>n</mml:mi>
                                <mml:mo>+</mml:mo>
                                <mml:mn>1</mml:mn>
                            </mml:mrow>
                            <mml:mn>2</mml:mn>
                        </mml:mfrac>
                    </mml:math>
</disp-formula>
            </p>
            <p>For the value of 
                <inline-formula>

                    <mml:math display="inline">
                        <mml:mi>n</mml:mi>
                    </mml:math>
</inline-formula> used in our simulations, this results in an approximate mean of 
                <inline-formula>

                    <mml:math display="inline">
                        <mml:mn>1.7014118346046923</mml:mn>
                        <mml:mo>&#x00d7;</mml:mo>
                        <mml:msup>
                            <mml:mn>10</mml:mn>
                            <mml:mn>38</mml:mn>
                        </mml:msup>
                    </mml:math>
</inline-formula>. The error in mean calculated for our chosen sample size is:
                <disp-formula id="e9">

                    <mml:math display="block">
                        <mml:mtext>Error in Mean</mml:mtext>
                        <mml:mo>=</mml:mo>
                        <mml:mo>&#x2212;</mml:mo>
                        <mml:mn>0.03381834297068176</mml:mn>
                        <mml:mo>%</mml:mo>
                    </mml:math>
</disp-formula>
            </p>
            <p>On a broader scale, the results from a large number of simulations conducted using this algorithm indicate that the error in mean consistently remains below 
                <inline-formula>

                    <mml:math display="inline">
                        <mml:mo>&#x00b1;</mml:mo>
                        <mml:mn>0.21</mml:mn>
                        <mml:mo>%</mml:mo>
                    </mml:math>
</inline-formula>. This demonstrates the reliability and accuracy of the algorithm in generating random numbers that closely adhere to the expected mean of the underlying distribution.</p>
        </sec>
        <sec id="sec9">
            <title>Testing and Results</title>
            <p>The test for the quality of the algorithm and the randomness of the sequence thus generated can be conducted under four different parts, each checking a different aspect of the sequence. From the example above (
                <xref ref-type="sec" rid="sec8">
section 3</xref>), here is the sequence of random numbers that were obtained:
                <disp-formula id="e10">

                    <mml:math display="block">
                        <mml:mtable displaystyle="true">
                            <mml:mtr>
                                <mml:mtd>
                                    <mml:maligngroup/>
                                    <mml:mn>6850768168405461780</mml:mn>
                                </mml:mtd>
                            </mml:mtr>
                            <mml:mtr>
                                <mml:mtd>
                                    <mml:maligngroup/>
                                    <mml:mn>17931181564508769381107265929</mml:mn>
                                </mml:mtd>
                            </mml:mtr>
                            <mml:mtr>
                                <mml:mtd>
                                    <mml:maligngroup/>
                                    <mml:mn>46933024901820254982869564459716412279</mml:mn>
                                </mml:mtd>
                            </mml:mtr>
                            <mml:mtr>
                                <mml:mtd>
                                    <mml:maligngroup/>
                                    <mml:mn>321994471083130446124683672239386547930</mml:mn>
                                </mml:mtd>
                            </mml:mtr>
                            <mml:mtr>
                                <mml:mtd>
                                    <mml:maligngroup/>
                                    <mml:mn>123048090386001761310298247717400910747</mml:mn>
                                </mml:mtd>
                            </mml:mtr>
                            <mml:mtr>
                                <mml:mtd>
                                    <mml:maligngroup/>
                                    <mml:mn>190488107609783521857697426807763758782</mml:mn>
                                </mml:mtd>
                            </mml:mtr>
                            <mml:mtr>
                                <mml:mtd>
                                    <mml:maligngroup/>
                                    <mml:mn>16617893273582357041392761262326671242</mml:mn>
                                </mml:mtd>
                            </mml:mtr>
                            <mml:mtr>
                                <mml:mtd>
                                    <mml:maligngroup/>
                                    <mml:mo>&#x22ee;</mml:mo>
                                </mml:mtd>
                            </mml:mtr>
                        </mml:mtable>
                    </mml:math>
</disp-formula>
</p>
            <sec id="sec10">
                <title>Choice of arbitrary seed</title>
                <p>The algorithm itself is defined in a way to function well with an arbitrary seed. The choice of seed as mentioned in equation ([eq:seed]) shows that this algorithm trivially has the notion of an arbitrary seed selection system, thus, freeing it from the problem of selecting seeds that do not yield good results. It is important to note that the algorithm always selects a prime number as its seed, by definition, even if a non-prime integer is given as an input. In case a non-prime integer is given as an input, the algorithm selects the closest prime number greater than that integer as the seed 
                    <inline-formula>

                        <mml:math display="inline">
                            <mml:msub>
                                <mml:mi>p</mml:mi>
                                <mml:mn>0</mml:mn>
                            </mml:msub>
                        </mml:math>
</inline-formula>. The range of 
                    <inline-formula>

                        <mml:math display="inline">
                            <mml:mrow>
                                <mml:mo stretchy="true">[</mml:mo>
                                <mml:mn>100</mml:mn>
                                <mml:mo>,</mml:mo>
                                <mml:mo mathvariant="italic">max</mml:mo>
                                <mml:mrow>
                                    <mml:mo stretchy="true">(</mml:mo>
                                    <mml:mn>1000</mml:mn>
                                    <mml:mo>,</mml:mo>
                                    <mml:msup>
                                        <mml:mn>2</mml:mn>
                                        <mml:mrow>
                                            <mml:mo stretchy="true">&#x230a;</mml:mo>
                                            <mml:mfrac>
                                                <mml:mi>m</mml:mi>
                                                <mml:mn>4</mml:mn>
                                            </mml:mfrac>
                                            <mml:mo stretchy="true">&#x230b;</mml:mo>
                                        </mml:mrow>
                                    </mml:msup>
                                    <mml:mo stretchy="true">)</mml:mo>
                                </mml:mrow>
                                <mml:mo stretchy="true">]</mml:mo>
                            </mml:mrow>
                        </mml:math>
</inline-formula> has only been introduced as a convention to reduce the computational overhead of just selecting a seed. The only constraint that we&#x2019;ve faced is when the value of the seed 
                    <inline-formula>

                        <mml:math display="inline">
                            <mml:msub>
                                <mml:mi>p</mml:mi>
                                <mml:mn>0</mml:mn>
                            </mml:msub>
                        </mml:math>
</inline-formula> is very small compared to 
                    <inline-formula>

                        <mml:math display="inline">
                            <mml:msup>
                                <mml:mn>2</mml:mn>
                                <mml:mi>m</mml:mi>
                            </mml:msup>
                        </mml:math>
</inline-formula>. In this case, the first few numbers of the generated sequence are also smaller values and thus shift away from the notion of randomness in the whole distribution. In such a case, the lower bound of the range can be chosen to be a higher number masted on the magnitude of 
                    <inline-formula>

                        <mml:math display="inline">
                            <mml:mi>m</mml:mi>
                        </mml:math>
</inline-formula>.</p>
            </sec>
            <sec id="sec11">
                <title>Occurrence of periodic cycles</title>
                <p>A common problem of PRNG&#x2019;s are the occurrence of periodic cycles in the sequence. Since the algorithms are deterministic, once a random number is generated that is equal to some previous number in the sequence, the whole algorithm starts repeating itself, or atleast has a chance to do so. The is the most common problem for using LCG&#x2019;s,
                    <sup>
                        <xref ref-type="bibr" rid="ref7">7</xref>
                    </sup> where one must be really careful in the selection of seeds and parameters for maximal cycle formation. However, in MAXEM, the possibility of a periodic cycle formation has simply been eliminated. The same number may be generated more than once, but the scenario will not lead to the repetition of the whole sequence. We can see that, from equation ([eq:entropy]), the term 
                    <inline-formula>

                        <mml:math display="inline">
                            <mml:msub>
                                <mml:mi>x</mml:mi>
                                <mml:mi>i</mml:mi>
                            </mml:msub>
                        </mml:math>
</inline-formula> depends directly on the product of the terms 
                    <inline-formula>

                        <mml:math display="inline">
                            <mml:mi>i</mml:mi>
                        </mml:math>
</inline-formula> and 
                    <inline-formula>

                        <mml:math display="inline">
                            <mml:msub>
                                <mml:mi>p</mml:mi>
                                <mml:mrow>
                                    <mml:mi>i</mml:mi>
                                    <mml:mo>&#x2212;</mml:mo>
                                    <mml:mn>1</mml:mn>
                                </mml:mrow>
                            </mml:msub>
                        </mml:math>
</inline-formula>. It is going to be highly unlikely for 
                    <inline-formula>

                        <mml:math display="inline">
                            <mml:mtext mathvariant="italic">bmod</mml:mtext>
                            <mml:msup>
                                <mml:mn>2</mml:mn>
                                <mml:mi>m</mml:mi>
                            </mml:msup>
                        </mml:math>
</inline-formula> [equation([eq:entropy])] to generate the same term as it had before, because both 
                    <inline-formula>

                        <mml:math display="inline">
                            <mml:mi>i</mml:mi>
                        </mml:math>
</inline-formula> and 
                    <inline-formula>

                        <mml:math display="inline">
                            <mml:msub>
                                <mml:mi>p</mml:mi>
                                <mml:mi>i</mml:mi>
                            </mml:msub>
                        </mml:math>
</inline-formula> are changing. Thus, the chances that the whole sequence repeats is almost equal to null. This has also been verified by simulation after running the algorithm many times, with not a single case of formation of periodic cycles.</p>
            </sec>
            <sec id="sec12">
                <title>Test for randomness with run test</title>
                <p>As discussed by Ross in Introductory Statistics (Third Edition),
                    <sup>
                        <xref ref-type="bibr" rid="ref11">11</xref>
                    </sup> non-parametric hypothesis tests, such as the Wald Wolfowitz run test for randomness, are useful when no specific distribution is assumed. The run test evaluates the randomness of a sequence by analyzing the occurrence of &#x2018;runs&#x2019;&#x2014;sequences of consecutive identical elements. A significant deviation in the number of runs from what is expected under randomness suggests the sequence may not be random. The Run test has been carried out on the whole sequence with the following hypothesis:</p>
                <disp-quote>
                    <p>

                        <inline-formula>

                            <mml:math display="inline">
                                <mml:msub>
                                    <mml:mi>H</mml:mi>
                                    <mml:mn>0</mml:mn>
                                </mml:msub>
                                <mml:mo>:</mml:mo>
                                <mml:mtext>The given sequence is random</mml:mtext>
                                <mml:mo>,</mml:mo>
                                <mml:mspace width="0.25em"/>
                                <mml:msub>
                                    <mml:mi>H</mml:mi>
                                    <mml:mn>1</mml:mn>
                                </mml:msub>
                                <mml:mo>:</mml:mo>
                                <mml:mtext>The given sequence is not random</mml:mtext>
                            </mml:math>
</inline-formula>
                    </p>
                </disp-quote>
                <p>We have failed to reject the Null Hypothesis (
                    <inline-formula>

                        <mml:math display="inline">
                            <mml:msub>
                                <mml:mi>H</mml:mi>
                                <mml:mn>0</mml:mn>
                            </mml:msub>
                        </mml:math>
</inline-formula>) for every single time the algorithm has been run, thus concluding that the sequence thus generated by MAXEM can be considered random.</p>
                <p>From the example above (
                    <xref ref-type="sec" rid="sec8">
section 3</xref>), here is the sequence of letters that were generated and considered for the run test:
                    <disp-formula id="e11">

                        <mml:math display="block">
                            <mml:mrow>
                                <mml:mo stretchy="true">[</mml:mo>
                                <mml:mi mathvariant="normal">l</mml:mi>
                                <mml:mo>,</mml:mo>
                                <mml:mi mathvariant="normal">l</mml:mi>
                                <mml:mo>,</mml:mo>
                                <mml:mi mathvariant="normal">l</mml:mi>
                                <mml:mo>,</mml:mo>
                                <mml:mi mathvariant="normal">m</mml:mi>
                                <mml:mo>,</mml:mo>
                                <mml:mi mathvariant="normal">l</mml:mi>
                                <mml:mo>,</mml:mo>
                                <mml:mi mathvariant="normal">m</mml:mi>
                                <mml:mo>,</mml:mo>
                                <mml:mi mathvariant="normal">l</mml:mi>
                                <mml:mo>,</mml:mo>
                                <mml:mi mathvariant="normal">m</mml:mi>
                                <mml:mo>,</mml:mo>
                                <mml:mi mathvariant="normal">m</mml:mi>
                                <mml:mo>,</mml:mo>
                                <mml:mi mathvariant="normal">l</mml:mi>
                                <mml:mo>,</mml:mo>
                                <mml:mi mathvariant="normal">m</mml:mi>
                                <mml:mo>,</mml:mo>
                                <mml:mi mathvariant="normal">l</mml:mi>
                                <mml:mo>,</mml:mo>
                                <mml:mi mathvariant="normal">l</mml:mi>
                                <mml:mo>,</mml:mo>
                                <mml:mi mathvariant="normal">l</mml:mi>
                                <mml:mo>,</mml:mo>
                                <mml:mi mathvariant="normal">m</mml:mi>
                                <mml:mo>,</mml:mo>
                                <mml:mi mathvariant="normal">l</mml:mi>
                                <mml:mo>,</mml:mo>
                                <mml:mi mathvariant="normal">m</mml:mi>
                                <mml:mo>,</mml:mo>
                                <mml:mi mathvariant="normal">m</mml:mi>
                                <mml:mo>,</mml:mo>
                                <mml:mi mathvariant="normal">l</mml:mi>
                                <mml:mo>,</mml:mo>
                                <mml:mi mathvariant="normal">m</mml:mi>
                                <mml:mo>,</mml:mo>
                                <mml:mi mathvariant="normal">l</mml:mi>
                                <mml:mo>,</mml:mo>
                                <mml:mi mathvariant="normal">m</mml:mi>
                                <mml:mo>,</mml:mo>
                                <mml:mi mathvariant="normal">m</mml:mi>
                                <mml:mo>,</mml:mo>
                                <mml:mi mathvariant="normal">m</mml:mi>
                                <mml:mo>,</mml:mo>
                                <mml:mi mathvariant="normal">m</mml:mi>
                                <mml:mo>,</mml:mo>
                                <mml:mi mathvariant="normal">l</mml:mi>
                                <mml:mo>,</mml:mo>
                                <mml:mi mathvariant="normal">l</mml:mi>
                                <mml:mo>,</mml:mo>
                                <mml:mi mathvariant="normal">l</mml:mi>
                                <mml:mo>,</mml:mo>
                                <mml:mi mathvariant="normal">m</mml:mi>
                                <mml:mo>,</mml:mo>
                                <mml:mi mathvariant="normal">m</mml:mi>
                                <mml:mo>,</mml:mo>
                                <mml:mo>&#x2026;</mml:mo>
                                <mml:mo stretchy="true">]</mml:mo>
                            </mml:mrow>
                        </mml:math>
</disp-formula>
                </p>
                <p>Here, 
                    <inline-formula>

                        <mml:math display="inline">
                            <mml:mi>l</mml:mi>
                            <mml:mo>:</mml:mo>
                            <mml:msub>
                                <mml:mi>x</mml:mi>
                                <mml:mi>i</mml:mi>
                            </mml:msub>
                            <mml:mo>&lt;</mml:mo>
                            <mml:mtext mathvariant="italic">Median</mml:mtext>
                            <mml:mrow>
                                <mml:mo stretchy="true">(</mml:mo>
                                <mml:mo stretchy="true">{</mml:mo>
                                <mml:msub>
                                    <mml:mi>x</mml:mi>
                                    <mml:mi>n</mml:mi>
                                </mml:msub>
                                <mml:mo stretchy="true">}</mml:mo>
                                <mml:mo stretchy="true">)</mml:mo>
                            </mml:mrow>
                            <mml:mspace width="0.25em"/>
                            <mml:mtext>and</mml:mtext>
                            <mml:mspace width="0.25em"/>
                            <mml:mi>m</mml:mi>
                            <mml:mo>:</mml:mo>
                            <mml:msub>
                                <mml:mi>x</mml:mi>
                                <mml:mi>i</mml:mi>
                            </mml:msub>
                            <mml:mspace width="0.25em"/>
                            <mml:mo>&#x2265;</mml:mo>
                            <mml:mspace width="0.25em"/>
                            <mml:mtext mathvariant="italic">Median</mml:mtext>
                            <mml:mrow>
                                <mml:mo stretchy="true">(</mml:mo>
                                <mml:mo stretchy="true">{</mml:mo>
                                <mml:msub>
                                    <mml:mi>x</mml:mi>
                                    <mml:mi>n</mml:mi>
                                </mml:msub>
                                <mml:mo stretchy="true">}</mml:mo>
                                <mml:mo stretchy="true">)</mml:mo>
                            </mml:mrow>
                        </mml:math>
</inline-formula>. We can see that the sequence has neither way too many runs, nor way too less of them, suggesting that there is very little chance of patterns forming in the sequence. If 
                    <inline-formula>

                        <mml:math display="inline">
                            <mml:mi>u</mml:mi>
                        </mml:math>
</inline-formula> be the total number of runs in a sequence and 
                    <inline-formula>

                        <mml:math display="inline">
                            <mml:msub>
                                <mml:mi>n</mml:mi>
                                <mml:mi>l</mml:mi>
                            </mml:msub>
                            <mml:mspace width="0.25em"/>
                            <mml:mtext>and</mml:mtext>
                            <mml:mspace width="0.25em"/>
                            <mml:msub>
                                <mml:mi>n</mml:mi>
                                <mml:mi>m</mml:mi>
                            </mml:msub>
                        </mml:math>
</inline-formula> be the number of 
                    <inline-formula>

                        <mml:math display="inline">
                            <mml:mi>l</mml:mi>
                        </mml:math>
</inline-formula>&#x2019;s and 
                    <inline-formula>

                        <mml:math display="inline">
                            <mml:mi>m</mml:mi>
                        </mml:math>
</inline-formula>&#x2019;s in the sequence respectively, we can calculate:
                    <disp-formula id="e12">

                        <mml:math display="block">
                            <mml:mi>&#x03bc;</mml:mi>
                            <mml:mrow>
                                <mml:mo stretchy="true">(</mml:mo>
                                <mml:mi>u</mml:mi>
                                <mml:mo stretchy="true">)</mml:mo>
                            </mml:mrow>
                            <mml:mo>=</mml:mo>
                            <mml:mfrac>
                                <mml:mrow>
                                    <mml:mi>n</mml:mi>
                                    <mml:mo>+</mml:mo>
                                    <mml:mn>2</mml:mn>
                                    <mml:msub>
                                        <mml:mi>n</mml:mi>
                                        <mml:mi>l</mml:mi>
                                    </mml:msub>
                                    <mml:mo>&#x00b7;</mml:mo>
                                    <mml:msub>
                                        <mml:mi>n</mml:mi>
                                        <mml:mi>m</mml:mi>
                                    </mml:msub>
                                </mml:mrow>
                                <mml:mi>n</mml:mi>
                            </mml:mfrac>
                        </mml:math>
</disp-formula>

                    <disp-formula id="e13">

                        <mml:math display="block">
                            <mml:mi>&#x03c3;</mml:mi>
                            <mml:msup>
                                <mml:mrow>
                                    <mml:mo stretchy="true">(</mml:mo>
                                    <mml:mi>u</mml:mi>
                                    <mml:mo stretchy="true">)</mml:mo>
                                </mml:mrow>
                                <mml:mn>2</mml:mn>
                            </mml:msup>
                            <mml:mo>=</mml:mo>
                            <mml:mfrac>
                                <mml:mrow>
                                    <mml:mrow>
                                        <mml:mo stretchy="true">[</mml:mo>
                                        <mml:mi>&#x03bc;</mml:mi>
                                        <mml:mrow>
                                            <mml:mo stretchy="true">(</mml:mo>
                                            <mml:mi>u</mml:mi>
                                            <mml:mo stretchy="true">)</mml:mo>
                                        </mml:mrow>
                                        <mml:mo>&#x2212;</mml:mo>
                                        <mml:mn>1</mml:mn>
                                        <mml:mo stretchy="true">]</mml:mo>
                                    </mml:mrow>
                                    <mml:mrow>
                                        <mml:mo stretchy="true">[</mml:mo>
                                        <mml:mi>&#x03bc;</mml:mi>
                                        <mml:mrow>
                                            <mml:mo stretchy="true">(</mml:mo>
                                            <mml:mi>u</mml:mi>
                                            <mml:mo stretchy="true">)</mml:mo>
                                        </mml:mrow>
                                        <mml:mo>&#x2212;</mml:mo>
                                        <mml:mn>2</mml:mn>
                                        <mml:mo stretchy="true">]</mml:mo>
                                    </mml:mrow>
                                </mml:mrow>
                                <mml:mrow>
                                    <mml:mi>n</mml:mi>
                                    <mml:mo>&#x2212;</mml:mo>
                                    <mml:mn>1</mml:mn>
                                </mml:mrow>
                            </mml:mfrac>
                        </mml:math>
</disp-formula>

                    <disp-formula id="e14">

                        <mml:math display="block">
                            <mml:mi mathvariant="normal">Z</mml:mi>
                            <mml:mo>=</mml:mo>
                            <mml:mfrac>
                                <mml:mrow>
                                    <mml:mi mathvariant="normal">u</mml:mi>
                                    <mml:mo>&#x2212;</mml:mo>
                                    <mml:mi mathvariant="normal">&#x03bc;</mml:mi>
                                    <mml:mrow>
                                        <mml:mo stretchy="true">(</mml:mo>
                                        <mml:mi mathvariant="normal">u</mml:mi>
                                        <mml:mo stretchy="true">)</mml:mo>
                                    </mml:mrow>
                                </mml:mrow>
                                <mml:mrow>
                                    <mml:mi mathvariant="normal">&#x03c3;</mml:mi>
                                    <mml:mrow>
                                        <mml:mo stretchy="true">(</mml:mo>
                                        <mml:mi mathvariant="normal">u</mml:mi>
                                        <mml:mo stretchy="true">)</mml:mo>
                                    </mml:mrow>
                                </mml:mrow>
                            </mml:mfrac>
                        </mml:math>
</disp-formula>where 
                    <inline-formula>

                        <mml:math display="inline">
                            <mml:mi>&#x03bc;</mml:mi>
                            <mml:mrow>
                                <mml:mo stretchy="true">(</mml:mo>
                                <mml:mi>u</mml:mi>
                                <mml:mo stretchy="true">)</mml:mo>
                            </mml:mrow>
                        </mml:math>
</inline-formula> is the expected number of runs and 
                    <inline-formula>

                        <mml:math display="inline">
                            <mml:mi>&#x03c3;</mml:mi>
                            <mml:mrow>
                                <mml:mo stretchy="true">(</mml:mo>
                                <mml:mi>u</mml:mi>
                                <mml:mo stretchy="true">)</mml:mo>
                            </mml:mrow>
                        </mml:math>
</inline-formula> is the standard error. If the Z-score(
                    <inline-formula>

                        <mml:math display="inline">
                            <mml:mi>Z</mml:mi>
                        </mml:math>
</inline-formula>) is such that 
                    <inline-formula>

                        <mml:math display="inline">
                            <mml:mo>|</mml:mo>
                            <mml:mi>Z</mml:mi>
                            <mml:mo>|</mml:mo>
                            <mml:mspace width="0.25em"/>
                            <mml:mo>&#x2264;</mml:mo>
                            <mml:mspace width="0.25em"/>
                            <mml:mn>1.96</mml:mn>
                        </mml:math>
</inline-formula> (taking a 5% significance level of the standard normal variate), then we accept the Null Hypothesis (
                    <inline-formula>

                        <mml:math display="inline">
                            <mml:msub>
                                <mml:mi>H</mml:mi>
                                <mml:mn>0</mml:mn>
                            </mml:msub>
                        </mml:math>
</inline-formula>), else reject it.</p>
            </sec>
            <sec id="sec13">
                <title>Test for local randomness</title>
                <p>Martin-L&#x00f6;f
                    <sup>
                        <xref ref-type="bibr" rid="ref12">12</xref>
                    </sup> introduced a formal way to define random sequences using algorithmic complexity. While a sequence might be considered random as a whole, this doesn&#x2019;t mean that every subsequence will also be random. The randomness of a full sequence doesn&#x2019;t carry over automatically to its parts, as a subsequence might still follow some patterns depending on how it&#x2019;s selected.</p>
                <p>With this in mind, we tested the sequence generated by MAXEM following a simple algorithm as given below.</p>
                <p>Choose an initial value for 
                    <monospace>len</monospace> Choose an arbitrary number 
                    <inline-formula>

                        <mml:math display="inline">
                            <mml:mi>y</mml:mi>
                            <mml:mspace width="0.25em"/>
                            <mml:mo>&#x2208;</mml:mo>
                            <mml:mspace width="0.25em"/>
                            <mml:mrow>
                                <mml:mo stretchy="true">[</mml:mo>
                                <mml:mn>0</mml:mn>
                                <mml:mo>,</mml:mo>
                                <mml:mi>n</mml:mi>
                                <mml:mo>&#x2212;</mml:mo>
                                <mml:mi mathvariant="italic">len</mml:mi>
                                <mml:mo stretchy="true">]</mml:mo>
                            </mml:mrow>
                        </mml:math>
</inline-formula> Select subsequence of length 
                    <monospace>len</monospace> starting at position 
                    <inline-formula>

                        <mml:math display="inline">
                            <mml:mi>y</mml:mi>
                        </mml:math>
</inline-formula> Conduct a run test on each subsequence. Let 
                    <inline-formula>

                        <mml:math display="inline">
                            <mml:mi>z</mml:mi>
                        </mml:math>
</inline-formula> = number of times the run test is satisfied Compute 
                    <inline-formula>

                        <mml:math display="inline">
                            <mml:mtext mathvariant="italic">success</mml:mtext>
                            <mml:mo>_</mml:mo>
                            <mml:mtext mathvariant="italic">percentag</mml:mtext>
                            <mml:msub>
                                <mml:mi>e</mml:mi>
                                <mml:mi mathvariant="italic">len</mml:mi>
                            </mml:msub>
                            <mml:mo>=</mml:mo>
                            <mml:mfrac>
                                <mml:mi>z</mml:mi>
                                <mml:mn>1000</mml:mn>
                            </mml:mfrac>
                            <mml:mo>&#x00d7;</mml:mo>
                            <mml:mn>100</mml:mn>
                        </mml:math>
</inline-formula> Increase 
                    <monospace>len</monospace> gradually, starting with small intervals and increasing the gap for larger values.</p>
                <p>
                    <xref ref-type="fig" rid="f2">
Figure 2</xref> shows the results of local randomness test for 
                    <inline-formula>

                        <mml:math display="inline">
                            <mml:mi mathvariant="italic">len</mml:mi>
                        </mml:math>
</inline-formula> values like 30, 40, 50, 100, 150, 200, 400,&#x2026;, upto 20000. The high success results prove how the sequence generated by MAXEM is not only random globally, but also locally.</p>
                <fig fig-type="figure" id="f2" orientation="portrait" position="float">
                    <label>
Figure 2. </label>
                    <caption>
                        <title>Local randomness testing with subsequences of various lengths.</title>
                    </caption>
                    <graphic id="gr2" orientation="portrait" position="float" xlink:href="https://f1000research-files.f1000.com/manuscripts/182325/8ff7d115-1d44-45b5-904a-e0db9017318b_figure2.gif"/>
                </fig>
                <p>These analyses indicate that MAXEM provides a high level of randomness with good scalability. Benchmarks like TestU01, designed by L&#x2019;Ecuyer and Simard,
                    <sup>
                        <xref ref-type="bibr" rid="ref13">13</xref>
                    </sup> provide a comprehensive framework to evaluate PRNG performance, and can be used to conduct further analyses on the robustness of the MAXEM algorithm.</p>
            </sec>
        </sec>
        <sec id="sec14" sec-type="conclusion">
            <title>Conclusion</title>
            <p>The proposed PRNG algorithm suggests a new way of creating pseudo-random numbers through the use of a combination of modular arithmetic, bitwise operations, and entropy modulation. This section summarizes the main features of the algorithm, its capabilities, and its pros and cons.</p>
            <sec id="sec15">
                <title>Performance and complexity</title>
                <p>The worst-case time complexity of the algorithm is primarily dominated by the modular multiplication and can be given as 
                    <inline-formula>

                        <mml:math display="inline">
                            <mml:mi>O</mml:mi>
                            <mml:mrow>
                                <mml:mo stretchy="true">(</mml:mo>
                                <mml:mi>n</mml:mi>
                                <mml:mo>&#x00b7;</mml:mo>
                                <mml:mtext mathvariant="italic">mlogm</mml:mtext>
                                <mml:mo stretchy="true">)</mml:mo>
                            </mml:mrow>
                        </mml:math>
</inline-formula> if faster and more optimized multiplication such as Karatsuba&#x2019;s algorithm
                    <sup>
                        <xref ref-type="bibr" rid="ref14">14</xref>
                    </sup> is used. This algorithmic complexity does not take into account the complexity of the separate function that finds the nearest prime number for the seed, as it can be (and should be) done separately or by parallel methods. We can see that this is computationally more expensive that other common PRNGs succh as the Mersenne Twister algorithm.
                    <sup>
                        <xref ref-type="bibr" rid="ref3">3</xref>
                    </sup> However, the trade-off is justified by increased entropy and unpredictability.</p>
                <p>The space complexity of MAXEM remains to be 
                    <inline-formula>

                        <mml:math display="inline">
                            <mml:mi>O</mml:mi>
                            <mml:mrow>
                                <mml:mo stretchy="true">(</mml:mo>
                                <mml:mi>m</mml:mi>
                                <mml:mo stretchy="true">)</mml:mo>
                            </mml:mrow>
                        </mml:math>
</inline-formula>, as is the case with most other common PRNGs.</p>
            </sec>
            <sec id="sec16">
                <title>Advantages</title>
                <p>The major goals of the MAXEM algorithm are to negate the formation of periodic cycles in a sequence of random numbers and also preserve the quality (randomness) of the sequence with the selection of an arbitrary seed. This makes MAXEM stand apart from the other traditional PRNGs like the Linear Congruential Generator.
                    <sup>
                        <xref ref-type="bibr" rid="ref2">2</xref>
                    </sup>
                </p>
                <p>This algorithm, given a high value of 
                    <inline-formula>

                        <mml:math display="inline">
                            <mml:mi>m</mml:mi>
                        </mml:math>
</inline-formula>, also has great security. Due to the intrinsic features of this algorithm, reverse engineering this without a good guess on the final seed would be difficult as one would need to guess both the iteration number and the seed, given that the seed is a prime number of x bits, where x is quite large. This task is not impossible but quite arduous. Hence, this algorithm can also be great for use in cryptography
                    <sup>
                        <xref ref-type="bibr" rid="ref15">15</xref>
                    </sup> and other security measures.</p>
                <p>The ability to adjust the bit range 
                    <inline-formula>

                        <mml:math display="inline">
                            <mml:msup>
                                <mml:mn>2</mml:mn>
                                <mml:mi>m</mml:mi>
                            </mml:msup>
                        </mml:math>
</inline-formula> offers significant flexibility. By selecting appropriate values for 
                    <inline-formula>

                        <mml:math display="inline">
                            <mml:mi>m</mml:mi>
                        </mml:math>
</inline-formula>, the generator can be tuned for different use cases, whether it&#x2019;s cryptographic applications or scientific simulations.</p>
            </sec>
            <sec id="sec17">
                <title>Limitations</title>
                <p>Despite the advantages of the MAXEM algorithm, the inherent high computational complexity can be a limiting factor and make the generation of sequences for large values of 
                    <inline-formula>

                        <mml:math display="inline">
                            <mml:mi>m</mml:mi>
                            <mml:mspace width="0.25em"/>
                            <mml:mtext>and</mml:mtext>
                            <mml:mspace width="0.25em"/>
                            <mml:mi>n</mml:mi>
                        </mml:math>
</inline-formula> very slow to the extent that it becomes unsuitable for real-time applications. However, taking advantage of these modern techniques such as parallel computing can significantly help in the process of improving the efficiency of the system without a sacrifice of quality.</p>
            </sec>
        </sec>
        <sec id="sec18">
            <title>Future directions</title>
            <p>The MAXEM algorithm has its own perks and limitations. Here listed are a few directions in which research can be conducted to contribute to MAXEM, making it even more powerful and efficient:
                <list list-type="bullet">
                    <list-item>
                        <label>&#x2022;</label>
                        <p>MAXEM can be modified by combining it with other PRNGs with better computational complexity to balance its speed with its quality. A hybrid approach might help to create an even stronger algorithm that combines the strength of the other PRNGs.</p>
                    </list-item>
                    <list-item>
                        <label>&#x2022;</label>
                        <p>Analysing the algorithm for its resistance to common cryptanalytic attacks such as brute-force or statistical attacks, with formal proofs, can help to establish the viability of the algorithm for cryptographic applications.</p>
                    </list-item>
                    <list-item>
                        <label>&#x2022;</label>
                        <p>Given the computational expense of modular arithmetic, parallelizing the algorithm could improve its performance in generating large sequences. Research into parallel or distributed implementations of the algorithm could make it more scalable.</p>
                    </list-item>
                </list>
            </p>
            <sec id="sec19">
                <title>Declaration of data availability</title>
                <p>The authors further declare that the data used in the work was not obtained from any external sources. All data supporting the results in this study were generated by the authors using the MAXEM algorithm, using their own code. The full dataset (random sequences, statistical measures, and plots) and the implementation code are publicly available on Zenodo at: 
                    <ext-link ext-link-type="uri" xlink:href="https://doi.org/10.5281/zenodo.15631843">https://doi.org/10.5281/zenodo.15631843</ext-link>.
                    <sup>
                        <xref ref-type="bibr" rid="ref16">16</xref>
                    </sup>
                </p>
                <p>Data are available under the terms of the 
                    <ext-link ext-link-type="uri" xlink:href="https://creativecommons.org/licenses/by/4.0/">Creative Commons Attribution 4.0 International license</ext-link> (CC-BY 4.0).</p>
            </sec>
            <sec id="sec20">
                <title>Ethical declarations</title>
                <p>The authors also declare that this study does not involve any human or animal participants, data, or tissue.</p>
            </sec>
        </sec>
    </body>
    <back>
        <ref-list>
            <title>References</title>
            <ref id="ref1">
                <label>1</label>
                <mixed-citation publication-type="journal">
                    <person-group person-group-type="author">

                        <name name-style="western">
                            <surname>Neyman</surname>
                            <given-names>J</given-names>
                        </name>
</person-group>:
                    <article-title>On the two different aspects of the representative method: The method of stratified sampling and the method of purposive selection.</article-title>
                    <source>

                        <italic toggle="yes">J. Am. Stat. Assoc.</italic>
</source>
                    <year>1934</year>;<volume>29</volume>(<issue>1</issue>):<fpage>538</fpage>&#x2013;<lpage>539</lpage>.</mixed-citation>
            </ref>
            <ref id="ref2">
                <label>2</label>
                <mixed-citation publication-type="book">
                    <person-group person-group-type="author">

                        <name name-style="western">
                            <surname>Knuth</surname>
                            <given-names>DE</given-names>
                        </name>
</person-group>:
                    <source>

                        <italic toggle="yes">The art of computer programming, volume 1: Fundamental algorithms.</italic>
</source>
                    <publisher-loc>Massachusetts</publisher-loc>:
                    <publisher-name>Addison-Wesley</publisher-name>;
                    <edition>3rd ed. </edition>
                    <year>1997</year>.</mixed-citation>
            </ref>
            <ref id="ref3">
                <label>3</label>
                <mixed-citation publication-type="journal">
                    <person-group person-group-type="author">

                        <name name-style="western">
                            <surname>Matsumoto</surname>
                            <given-names>M</given-names>
                        </name>

                        <name name-style="western">
                            <surname>Nishimura</surname>
                            <given-names>T</given-names>
                        </name>
</person-group>:
                    <article-title>Mersenne twister: A 623-dimensionally equidistributed uniform pseudo-random number generator.</article-title>
                    <source>

                        <italic toggle="yes">ACM Transactions on Modeling and Computer Simulation.</italic>
</source>
                    <year>1998</year>;<volume>8</volume>(<issue>1</issue>):<fpage>3</fpage>&#x2013;<lpage>30</lpage>.
                    <pub-id pub-id-type="doi">10.1145/272991.272995</pub-id>
                </mixed-citation>
            </ref>
            <ref id="ref4">
                <label>4</label>
                <mixed-citation publication-type="book">
                    <person-group person-group-type="author">

                        <name name-style="western">
                            <surname>Ferguson</surname>
                            <given-names>N</given-names>
                        </name>

                        <name name-style="western">
                            <surname>Schneier</surname>
                            <given-names>B</given-names>
                        </name>
</person-group>:
                    <source>

                        <italic toggle="yes">Practical cryptography.</italic>
</source>
                    <publisher-name>Wiley Publishing</publisher-name>;<year>2004</year>.</mixed-citation>
            </ref>
            <ref id="ref5">
                <label>5</label>
                <mixed-citation publication-type="journal">
                    <person-group person-group-type="author">

                        <name name-style="western">
                            <surname>Chakraborty</surname>
                            <given-names>S</given-names>
                        </name>
</person-group>:
                    <article-title>On why and what of randomness.</article-title>
                    <source>

                        <italic toggle="yes">ArXiv.</italic>
</source>
                    <year>2009</year>;<volume>abs/0902.1232</volume>.
                    <ext-link ext-link-type="uri" xlink:href="https://api.semanticscholar.org/CorpusID:18718036">Reference Source</ext-link>
                </mixed-citation>
            </ref>
            <ref id="ref6">
                <label>6</label>
                <mixed-citation publication-type="journal">
                    <person-group person-group-type="author">

                        <name name-style="western">
                            <surname>Berezowski</surname>
                            <given-names>M</given-names>
                        </name>
</person-group>:
                    <article-title>Chaotic distribution of prime numbers and digits of 
                        <inline-formula>
                            <mml:math display="inline">
                                <mml:mi>&#x03c0;</mml:mi>
                            </mml:math>
                        </inline-formula>.</article-title>
                    <source>

                        <italic toggle="yes">SSRN Electron. J.</italic>
</source>
                    <year>2019</year>.
                    <pub-id pub-id-type="doi">10.2139/ssrn.3562793</pub-id>
                </mixed-citation>
            </ref>
            <ref id="ref7">
                <label>7</label>
                <mixed-citation publication-type="book">
                    <person-group person-group-type="author">

                        <name name-style="western">
                            <surname>Tezuka</surname>
                            <given-names>S</given-names>
                        </name>
</person-group>:
                    <chapter-title>Linear congruential generators.</chapter-title>
                    <source>

                        <italic toggle="yes">Uniform random numbers.</italic>
</source>
                    <publisher-loc>Boston, MA</publisher-loc>:
                    <publisher-name>Springer</publisher-name>;<year>1995</year>; vol.<volume>315</volume>.</mixed-citation>
            </ref>
            <ref id="ref8">
                <label>8</label>
                <mixed-citation publication-type="journal">
                    <person-group person-group-type="author">

                        <name name-style="western">
                            <surname>Marsaglia</surname>
                            <given-names>G</given-names>
                        </name>
</person-group>:
                    <article-title>Xorshift RNGs.</article-title>
                    <source>

                        <italic toggle="yes">J. Stat. Softw.</italic>
</source>
                    <year>2003</year>;<volume>8</volume>(<issue>1</issue>):<fpage>14</fpage>.
                    <pub-id pub-id-type="doi">10.18637/jss.v008.i14</pub-id>
                </mixed-citation>
            </ref>
            <ref id="ref9">
                <label>9</label>
                <mixed-citation publication-type="other">
                    <collab>Python Software Foundation</collab>:
                    <article-title>Python language reference.</article-title>
                    <year>2024</year>.
                    <ext-link ext-link-type="uri" xlink:href="https://www.python.org">Reference Source</ext-link>
                </mixed-citation>
            </ref>
            <ref id="ref10">
                <label>10</label>
                <mixed-citation publication-type="other">
                    <collab>Google</collab>:
                    <article-title>Google colaboratory.</article-title>
                    <year>2024</year>.
                    <ext-link ext-link-type="uri" xlink:href="https://colab.research.google.com">Reference Source</ext-link>
                </mixed-citation>
            </ref>
            <ref id="ref11">
                <label>11</label>
                <mixed-citation publication-type="book">
                    <person-group person-group-type="author">

                        <name name-style="western">
                            <surname>Ross</surname>
                            <given-names>SM</given-names>
                        </name>
</person-group>:
                    <chapter-title>Nonparametric hypotheses tests.</chapter-title>
                    <source>

                        <italic toggle="yes">Introductory statistics.</italic>
</source>
                    <publisher-loc>Boston</publisher-loc>:
                    <publisher-name>Academic Press</publisher-name>;
                    <edition>Third </edition>
                    <year>2010</year>; pp.<fpage>647</fpage>&#x2013;<lpage>697</lpage>.</mixed-citation>
            </ref>
            <ref id="ref12">
                <label>12</label>
                <mixed-citation publication-type="journal">
                    <person-group person-group-type="author">

                        <name name-style="western">
                            <surname>Martin-L&#x00f6;f</surname>
                            <given-names>P</given-names>
                        </name>
</person-group>:
                    <article-title>The definition of random sequences.</article-title>
                    <source>

                        <italic toggle="yes">Inf. Control.</italic>
</source>
                    <year>1966</year>;<volume>9</volume>(<issue>6</issue>):<fpage>602</fpage>&#x2013;<lpage>619</lpage>.
                    <pub-id pub-id-type="doi">10.1016/S0019-9958(66)80018-9</pub-id>
                </mixed-citation>
            </ref>
            <ref id="ref13">
                <label>13</label>
                <mixed-citation publication-type="journal">
                    <person-group person-group-type="author">

                        <name name-style="western">
                            <surname>L&#x2019;Ecuyer</surname>
                            <given-names>P</given-names>
                        </name>

                        <name name-style="western">
                            <surname>Simard</surname>
                            <given-names>R</given-names>
                        </name>
</person-group>:
                    <article-title>TestU01: A c library for empirical testing of random number generators.</article-title>
                    <source>

                        <italic toggle="yes">ACM Transactions on Mathematical Software (TOMS).</italic>
</source>
                    <year>2007</year>;<volume>33</volume>(<issue>4</issue>):<fpage>1</fpage>&#x2013;<lpage>40</lpage>.
                    <pub-id pub-id-type="doi">10.1145/1268776.1268777</pub-id>
                </mixed-citation>
            </ref>
            <ref id="ref14">
                <label>14</label>
                <mixed-citation publication-type="journal">
                    <person-group person-group-type="author">

                        <name name-style="western">
                            <surname>Karatsuba</surname>
                            <given-names>A</given-names>
                        </name>

                        <name name-style="western">
                            <surname>Ofman</surname>
                            <given-names>Y</given-names>
                        </name>
</person-group>:
                    <article-title>Multiplication of many-digital numbers by automatic computers.</article-title>
                    <source>

                        <italic toggle="yes">Dokl. Akad. Nauk SSSR.</italic>
</source>
                    <year>1962</year>;<volume>145</volume>(<issue>2</issue>):<fpage>293</fpage>&#x2013;<lpage>294</lpage>.
                    <ext-link ext-link-type="uri" xlink:href="http://mi.mathnet.ru/dan26729">Reference Source</ext-link>
                </mixed-citation>
            </ref>
            <ref id="ref15">
                <label>15</label>
                <mixed-citation publication-type="other">
                    <person-group person-group-type="author">

                        <name name-style="western">
                            <surname>Goldreich</surname>
                            <given-names>O</given-names>
                        </name>
</person-group>:
                    <chapter-title>On the foundations of modern cryptography.</chapter-title>
                    <source>

                        <italic toggle="yes">Advances in cryptology &#x2014; CRYPTO&#x2019;97.</italic>
</source>
                    <year>1997</year>; pp.<fpage>46</fpage>&#x2013;<lpage>74</lpage>.
                    <pub-id pub-id-type="doi">10.1007/BFb0052227</pub-id>
                </mixed-citation>
            </ref>
            <ref id="ref16">
                <label>16</label>
                <mixed-citation publication-type="other">
                    <person-group person-group-type="author">

                        <name name-style="western">
                            <surname>Sadhukhan</surname>
                            <given-names>R</given-names>
                        </name>

                        <name name-style="western">
                            <surname>Chakrabory</surname>
                            <given-names>S</given-names>
                        </name>
</person-group>:
                    <article-title>MAXEM: A New Pseudo-Random Number Generating Algorithm with Implementation of Modulo Arithmetic, XORShift, and Entropy Modulation.</article-title>
                    <year>2025</year>.
                    <pub-id pub-id-type="doi">10.5281/zenodo.15631843</pub-id>
                </mixed-citation>
            </ref>
        </ref-list>
    </back>
    <sub-article article-type="reviewer-report" id="report433169">
        <front-stub>
            <article-id pub-id-type="doi">10.5256/f1000research.182325.r433169</article-id>
            <title-group>
                <article-title>Reviewer response for version 1</article-title>
            </title-group>
            <contrib-group>
                <contrib contrib-type="author">
                    <name>
                        <surname>Zhang</surname>
                        <given-names>Ran</given-names>
                    </name>
                    <xref ref-type="aff" rid="r433169a1">1</xref>
                    <role>Referee</role>
                    <uri content-type="orcid">https://orcid.org/0000-0001-5711-6475</uri>
                </contrib>
                <aff id="r433169a1">
                    <label>1</label>Max Planck Institute of Microstructure Physics:, Halle, Germany</aff>
            </contrib-group>
            <author-notes>
                <fn fn-type="conflict">
                    <p>
                        <bold>Competing interests: </bold>No competing interests were disclosed.</p>
                </fn>
            </author-notes>
            <pub-date pub-type="epub">
                <day>22</day>
                <month>11</month>
                <year>2025</year>
            </pub-date>
            <permissions>
                <copyright-statement>Copyright: &#x00a9; 2025 Zhang R</copyright-statement>
                <copyright-year>2025</copyright-year>
                <license xlink:href="https://creativecommons.org/licenses/by/4.0/">
                    <license-p>This is an open access peer review report distributed under the terms of the Creative Commons Attribution Licence, which permits unrestricted use, distribution, and reproduction in any medium, provided the original work is properly cited.</license-p>
                </license>
            </permissions>
            <related-article ext-link-type="doi" id="relatedArticleReport433169" related-article-type="peer-reviewed-article" xlink:href="10.12688/f1000research.165637.1"/>
            <custom-meta-group>
                <custom-meta>
                    <meta-name>recommendation</meta-name>
                    <meta-value>reject</meta-value>
                </custom-meta>
            </custom-meta-group>
        </front-stub>
        <body>
            <p>I have read the manuscript &#x201c;MAXEM: A New Pseudo-Random Number Generating Algorithm with Implementation of Modulo Arithmetic, XORShift, and Entropy Modulation&#x201d; with interest. The problem it addresses is important, and I appreciate the authors&#x2019; intention to propose a new generator by combining a modulo 2
                <sup>m</sup> linear component, a xorshift-style transformation, and a term based on consecutive primes. However, in its current form I do not think the paper reaches the scientific standard that would justify a positive recommendation.</p>
            <p> My main concern is that the central claims about the generator&#x2019;s behaviour are asserted rather than demonstrated. The manuscript repeatedly suggests that periodicity has been &#x201c;eliminated&#x201d; or that the chance of the entire sequence repeating is &#x201c;almost equal to null&#x201d;. For any realistic implementation with finite state, periodicity cannot be avoided and must instead be characterised and controlled. If the authors intend their construction to live in an unbounded state space with ever-increasing indices and primes, then the process is essentially non-stationary rather than &#x201c;non-periodic&#x201d; in a useful technical sense, and it is not clear how such a generator would be implemented or analysed in practice. A precise description of the state, and a careful explanation of what is meant by &#x201c;non-periodic&#x201d; in mathematical terms, are missing.</p>
            <p> The empirical evaluation is also far below current expectations for work on random number generators. The analysis is essentially limited to descriptive statistics, a runs test on a single long sequence, and a variant of the runs test on subsequences. These checks have very limited power and cannot substitute for a comprehensive test campaign using standard batteries such as TestU01 (SmallCrush/Crush/BigCrush), Dieharder, or the NIST suite. The authors mention TestU01 in passing but do not report any actual results. For a generator that manipulates bit patterns and is proposed as a general-purpose tool, a much broader and deeper empirical study is required before one can draw any confident conclusions about its quality.</p>
            <p> The way primes and &#x201c;entropy modulation&#x201d; are used also raises questions. The generator depends on a sequence of consecutive primes, with the initial prime chosen as the first prime above a random integer in a certain range. This immediately presumes the existence of some other reliable source of randomness for seeding. The subsequent use of the next prime after the previous one is presented as adding entropy, but in fact the whole process remains deterministic once the initial state is fixed, and the choice of primes is not analysed in terms of its structural effects on the sequence. Moreover, the cost of generating and storing ever-larger primes is essentially ignored in the complexity discussion, despite being integral to the algorithm. For any practical implementation, this cost cannot be separated from the generator itself.</p>
            <p> Related to this, the discussion of algorithmic complexity and efficiency is not convincing. The paper quotes a worst-case complexity dominated by modular multiplications and explicitly sets aside the cost of prime generation. It then compares MAXEM conceptually to widely used generators such as the Mersenne Twister without offering any timing measurements or realistic performance figures. Given the number and type of operations involved, it seems likely that MAXEM would be substantially slower than standard generators, and yet there is no careful assessment of whether the purported benefits justify this overhead.</p>
            <p> Towards the end of the manuscript the authors suggest that MAXEM could be suitable for cryptographic applications. I find this particularly problematic in the absence of any security model, adversarial analysis, or study of structural weaknesses. Cryptographic pseudorandom generators are held to a much higher standard than simulation-oriented RNGs, and there is no attempt here to argue about unpredictability under partial disclosure, resistance to known classes of attack, or any other security property. In my view, this claim should either be dropped or supported by substantial additional work.</p>
            <p> On a more positive note, I appreciate that the code and data have been made available, which is good practice and will facilitate independent experimentation. The general idea of combining a modulo 2
                <sup>m</sup> recurrence, a bitwise xorshift, and a non-linear arithmetic term is not without interest. With a much more careful formulation, a rigorous analysis of the underlying structure, and a comprehensive battery of empirical tests, some version of this idea might eventually yield a useful generator or at least a cautionary case study.</p>
            <p> At the level of presentation there are also several issues that could be improved: the definition of the algorithm would benefit from a cleaner and more formal specification of the state and recurrence; the motivation in the introduction could be made more concrete and less philosophical; and there are a number of typographical errors and minor inaccuracies in the references that should be corrected in any revision. These matters are secondary compared to the scientific concerns above, but they contribute to the overall impression that the work is not yet fully polished.</p>
            <p> In summary, while I appreciate the authors&#x2019; effort and the importance of the topic, the current manuscript lacks the theoretical analysis and the depth of empirical testing that the field now expects for a new random number generator, especially one that makes strong claims about non-periodicity and hints at cryptographic relevance. For these reasons I am unable to recommend approval at this stage, and my recommendation is &#x201c;Not approved&#x201d; for the present version.</p>
            <p>Is the work clearly and accurately presented and does it cite the current literature?</p>
            <p>No</p>
            <p>If applicable, is the statistical analysis and its interpretation appropriate?</p>
            <p>Partly</p>
            <p>Are all the source data underlying the results available to ensure full reproducibility?</p>
            <p>Partly</p>
            <p>Is the study design appropriate and is the work technically sound?</p>
            <p>Partly</p>
            <p>Are the conclusions drawn adequately supported by the results?</p>
            <p>Partly</p>
            <p>Are sufficient details of methods and analysis provided to allow replication by others?</p>
            <p>Partly</p>
            <p>Reviewer Expertise:</p>
            <p>true&#x00a0; random number generator, probabilistic computing, spintronics</p>
            <p>I confirm that I have read this submission and believe that I have an appropriate level of expertise to state that I do not consider it to be of an acceptable scientific standard, for reasons outlined above.</p>
        </body>
    </sub-article>
    <sub-article article-type="reviewer-report" id="report406145">
        <front-stub>
            <article-id pub-id-type="doi">10.5256/f1000research.182325.r406145</article-id>
            <title-group>
                <article-title>Reviewer response for version 1</article-title>
            </title-group>
            <contrib-group>
                <contrib contrib-type="author">
                    <name>
                        <surname>L'Ecuyer</surname>
                        <given-names>Pierre</given-names>
                    </name>
                    <xref ref-type="aff" rid="r406145a1">1</xref>
                    <role>Referee</role>
                    <uri content-type="orcid">https://orcid.org/0000-0002-3184-0796</uri>
                </contrib>
                <aff id="r406145a1">
                    <label>1</label>Universit&#x00e9; de Montr&#x00e9;al, &#x00c9;douard-Montpetit, Montreal, Canada</aff>
            </contrib-group>
            <author-notes>
                <fn fn-type="conflict">
                    <p>
                        <bold>Competing interests: </bold>No competing interests were disclosed.</p>
                </fn>
            </author-notes>
            <pub-date pub-type="epub">
                <day>1</day>
                <month>9</month>
                <year>2025</year>
            </pub-date>
            <permissions>
                <copyright-statement>Copyright: &#x00a9; 2025 L'Ecuyer P</copyright-statement>
                <copyright-year>2025</copyright-year>
                <license xlink:href="https://creativecommons.org/licenses/by/4.0/">
                    <license-p>This is an open access peer review report distributed under the terms of the Creative Commons Attribution Licence, which permits unrestricted use, distribution, and reproduction in any medium, provided the original work is properly cited.</license-p>
                </license>
            </permissions>
            <related-article ext-link-type="doi" id="relatedArticleReport406145" related-article-type="peer-reviewed-article" xlink:href="10.12688/f1000research.165637.1"/>
            <custom-meta-group>
                <custom-meta>
                    <meta-name>recommendation</meta-name>
                    <meta-value>reject</meta-value>
                </custom-meta>
            </custom-meta-group>
        </front-stub>
        <body>
            <p>
                <bold>General evaluation</bold>
            </p>
            <p> </p>
            <p> The authors propose a new nonperiodic RNG whose state at step i can be seen as the triple (i, x_i, p_i) where x_i is a m-bit integer and p_i is the first prime number larger than p_i&#x2212;1. The first prime number p_0 is selected &#x201c;at random&#x201d; and x_i is defined via a slightly complicated function of (i &#x2212; 1, x_i&#x2212;1, p_i&#x2212;1). Note that the size of the state increases with i and has no upper bound, because i and p_i increase without bound. The construction is purely heuristic, in the sense that there is no mathematical proof of uniformity or independence of the output values. For empirical statistical testing, the authors only report a simple visual plot for pairs of numbers and a run test with a small sample size. At a minimum, they should apply more stringent batteries of test like Crush and BigCrush of TestU01. Finally, it seems to me that this RNG will be extremely slow, since it requires finding a new large prime number at each step. The fast RNGs used for simulation nowadays can generate nearly one billion U(0, 1) random numbers per second on a single CPU. The authors should provide comparisons of their RNG with that. For recent tutorials/surveys on RNGs for simulation, see for example [102, 103] and other references given there. These papers argue that for good RNG constructions, one should have mathematical proofs of multidimensional uniformity of the output over the full period of the RNG. If the period is long enough, the periodicity is not an issue.</p>
            <p> </p>
            <p> 
                <bold>Specific comments and details </bold>
            </p>
            <p> </p>
            <p> 1. The first sentence of the introduction is incorrect. The &#x201c;law of statistical regularity&#x201d; does not say that and &#x201c;only when it is selected randomly&#x201d; is also not true. For example if you have a population of one million balls of which 20% are red, 30% are blue, and 50% are green, and you want a representative sample of 100 balls, then the most representative sample contains 20 red, 30 blue, and 50 green. A random sample cannot be more representative than this deterministic selection.</p>
            <p> </p>
            <p> 2. The Mersenne twister as important defects that were uncovered in [5]. Additional drawbacks of this RNG are discussed in [3], Section 2.</p>
            <p> </p>
            <p> 3. Page 4: Note that after the 2003 paper of Marsaglia, Xorshift RNGs have been shown to have major defects. See [1, 4].</p>
            <p> </p>
            <p> 4. In reference [2], note that Knuth discusses RNGs in his volume 2, not volume 1.</p>
            <p> </p>
            <p> 5. Reference [7] is incorrect: there is no &#x201c;Linear congruential generators&#x201d; in the book title.</p>
            <p> </p>
            <p> 6. What is the difference between Ref. [16] and the present paper?</p>
            <p>Is the work clearly and accurately presented and does it cite the current literature?</p>
            <p>Partly</p>
            <p>If applicable, is the statistical analysis and its interpretation appropriate?</p>
            <p>Partly</p>
            <p>Are all the source data underlying the results available to ensure full reproducibility?</p>
            <p>No</p>
            <p>Is the study design appropriate and is the work technically sound?</p>
            <p>Partly</p>
            <p>Are the conclusions drawn adequately supported by the results?</p>
            <p>No</p>
            <p>Are sufficient details of methods and analysis provided to allow replication by others?</p>
            <p>Yes</p>
            <p>Reviewer Expertise:</p>
            <p>Simulation, random number generation</p>
            <p>I confirm that I have read this submission and believe that I have an appropriate level of expertise to state that I do not consider it to be of an acceptable scientific standard, for reasons outlined above.</p>
        </body>
        <back>
            <ref-list>
                <title>References</title>
                <ref id="rep-ref-406145-1">
                    <label>1</label>
                    <mixed-citation>
                        <article-title>R. P. Brent. Note on Marsaglia&#x2019;s xorshift random number generators. Journal of Statistical Software, 11(5):1&#x2013;4, 2004.</article-title>
                    </mixed-citation>
                </ref>
                <ref id="rep-ref-406145-2">
                    <label>2</label>
                    <mixed-citation>
                        <article-title>P. L&#x2019;Ecuyer. Random number generation. In J. E. Gentle, W. Haerdle, and Y. Mori, editors, Handbook of Computational Statistics, pages 35&#x2013;71. Springer-Verlag, Berlin, second edition, 2012.</article-title>
                    </mixed-citation>
                </ref>
                <ref id="rep-ref-406145-3">
                    <label>3</label>
                    <mixed-citation>
                        <article-title>P. L&#x2019;Ecuyer, O. Nadeau-Chamard, Y.-F. Chen, and J. Lebar. Multiple streams with recurrence-based, counter-based, and splittable random number generators. In Proceedings of the 2021 Winter Simulation Conference, pages 1&#x2013;16. IEEE Press, 2021.</article-title>
                    </mixed-citation>
                </ref>
                <ref id="rep-ref-406145-4">
                    <label>4</label>
                    <mixed-citation>
                        <article-title>F. Panneton and P. L&#x2019;Ecuyer. On the xorshift random number generators. ACM Transactions on Modeling and Computer Simulation, 15(4):346&#x2013;361, 2005.</article-title>
                    </mixed-citation>
                </ref>
                <ref id="rep-ref-406145-5">
                    <label>5</label>
                    <mixed-citation>
                        <article-title>F. Panneton, P. L&#x2019;Ecuyer, and M. Matsumoto. Improved long-period generators based on linear recurrences modulo 2. ACM Transactions on Mathematical Software, 32(1):1&#x2013;16, 2006.</article-title>
                    </mixed-citation>
                </ref>
            </ref-list>
        </back>
    </sub-article>
</article>
