Recursive Random Number Generator Using Prime Reciprocals

Recursive Random Number Generator Using Prime Reciprocals
Notice: This research summary and analysis were automatically generated using AI technology. For absolute accuracy, please refer to the [Original Paper Viewer] below or the Original ArXiv Source.

A recursive random number generator using prime reciprocals is described.


💡 Research Summary

The paper investigates the use of prime reciprocal sequences—commonly called d‑sequences—as the basis for a new class of recursive random number generators (RNGs). A d‑sequence is obtained by expanding the reciprocal of a prime p (1/p) in a chosen radix and extracting its digits. In binary, the sequence can be generated by the simple recurrence a(i) = 2^i mod p mod 2. When 2 is a primitive root modulo p, the period of the binary d‑sequence reaches its theoretical maximum of p – 1; the second half of the period is the bitwise complement of the first half, giving a balanced distribution of 0s and 1s.

Although d‑sequences are easy to generate, a single sequence is insecure for cryptographic purposes because knowledge of roughly log₂ p bits of the output suffices to reconstruct the whole sequence. To overcome this limitation, the author proposes combining two or more d‑sequences using modulo‑2 addition (XOR). Each component sequence is derived from a different prime (p₁, p₂, …) and a seed S that is relatively prime to all chosen primes. The basic construction is:

a(0) = (S mod p₁ mod 2) ⊕ (S mod p₂ mod 2)
a(1) = (S² mod p₁ mod 2) ⊕ (S² mod p₂ mod 2)
a(2) = (S⁴ mod p₁ mod 2) ⊕ (S⁴ mod p₂ mod 2) …

If both component sequences are maximal‑length, the period of the XOR‑combined output is theoretically lcm(p₁ – 1, p₂ – 1). In practice the period may be a divisor of this value because the chosen primes need not both make 2 a primitive root, and the seed S may not be a primitive root for either modulus. To increase non‑linearity and further obscure the period, the author suggests raising the exponent for the second component by a factor k, yielding:

a(0) = (S mod p₁ mod 2) ⊕ (S^k mod p₂ mod 2)
a(1) = (S² mod p₁ mod 2) ⊕ (S^{2k} mod p₂ mod 2) …

Choosing k different from 1 makes the two streams evolve at incommensurate rates, which typically reduces the overall period below lcm(p₁ – 1, p₂ – 1) but makes prediction substantially harder.

For security, the paper recommends selecting primes congruent to 3 (mod 4) and, optionally, using composite moduli (products of primes) instead of single primes. This ties the difficulty of recovering S or the moduli to classic hard problems such as the quadratic residuosity problem. The construction also allows dynamic changes of S or k during operation, providing additional entropy.

The author further argues that any finite binary sequence can be expressed as a rational number, showing that linear feedback shift register (LFSR) sequences are a special case of d‑sequences. Conversely, d‑sequences are more general because they can represent any rational‑based sequence, though not all d‑sequences can be efficiently realized by LFSRs.

Practical implications are discussed: the ability to tailor the period to any desired length makes prime‑reciprocal based generators attractive for communication systems (e.g., spread‑spectrum codes), cryptographic protocols, and Monte‑Carlo simulations where specific statistical properties are required. The generator’s simplicity—requiring only modular exponentiation and XOR—makes it suitable for hardware implementation, while the flexibility in choosing primes, seeds, and exponent multipliers offers a wide design space for balancing performance, period length, and security.

In summary, the paper presents a novel recursive RNG architecture that leverages the arithmetic properties of prime reciprocals, introduces non‑linearity through XOR of multiple d‑sequences, and provides mechanisms (choice of primitive roots, composite moduli, exponent scaling) to control period and enhance cryptographic strength. This approach offers a compelling alternative to traditional linear generators, especially in applications where custom period lengths and easy hardware realization are valuable.


Comments & Academic Discussion

Loading comments...

Leave a Comment