Skip to content

ibzimh/Optimised-Prime-Number-Generator

Repository files navigation

Optimised-Prime-Number-Generator

What is the difference between the Optimised Generator and the Classical Generator?

(the markdown in brackets, i.e., (name) refer to the variable name in the code)

We try to minimise 'randomly' guessing candidates (c) for primes by selecting numbers with certain prime-like properties.

$\delta$ (delta) is a sequence of small exponents, $p$ (p) is a sequence of small prime numbers, $t = C \cdot max | \ p_{i}^{\delta_{i}} |$ (t, C), $\alpha$ is a sequence of sequences (alfi) of random numbers and $\theta$ (theta) is a sequence of $\theta_{i}$'s (theti) which are sequences of $0$'s with a $1$ at the $i^{\text{th}}$ position.

$$ \mathit{\Pi} = \prod_{i=1}^{k}{p_{i}^{\delta_{i}}} $$

$$ ( \alpha_{i}^{\delta_{i}} \cdot \theta_{i} \ ( \mathrm{mod} ) \ \mathit{\Pi} \neq 0 ) \ \longrightarrow \ c = \sum^{n} _ {i=1}{\alpha_{i}^{\delta_{i}} \cdot \theta_{i} \ ( \mathrm{mod} ) \ \mathit{\Pi}} { }$$

Where $c$ is an invertible number modulo $\mathit{\Pi}$

(This is as a result of the Chinese Remainder Theorem)

Now, like the classical generators, we generate $c$'s until we find a prime. (To be updated).

Files:

Naive Generator - Naive/Basic Implementation of Prime Number Generator
Classical Generator - Using some basic Number Theory theorems to make improvements to the Naive Generator
Optimised Generator - Using further number theory concepts to minimise random guessing and maximise accuracy
Composite Test - Miller-Rabin Deterministic Composite Test (more tests to be added soon!)
PrimeHelpers - List of functions to used in the generators.
HelperFunctions - List of useful array (and non-array) functions to avoid redundancy and make code cleaner

Misc. Files:
Primes1.txt - List of primes up until $2^{23}$
MakeListOfPrimes - Imports Primes.txt
CodeDump - Temporary local repository of the code.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages