ImtiazGermain
ImtiazGermain is a library intended for number theory, implementing an edited version of Germain primes, which got published in the book A Young Mathematician. Here is a algorithm for ImtiazGermain primes:
Input number n --> Calculate p = (n - 1) / 2 --> Check if n, p, and 2p + 1 are prime ------------------>
| | |
| No |
| | |
| V |
Output "n is not an Imtiaz Germain prime" <----- Stop |
| |
Yes |
| |
V |
Calculate m = 2p + 1 --> Check if m is composite --> Calculate q = 2m + 1 --> Check if q is prime -No-->|
| | |
| No Yes
| | |
| V V
Output "n is not an Imtiaz Germain prime" <----- Stop Output "n is an Imtiaz Germain prime"
Features
- Germain Primes detection
- Imtiaz-Germain primes detection
Installation
To use ImtiazGermain in your Rust project, add the following to your Cargo.toml
file:
[]
= "0.1.1"
Alternatively, you can go on python as:
pip install imtiazgermain
Usage
To use ImtiazGermain in your Rust code, import the necessary modules:
use ;
Then, call the desired encryption or utility function. For example, to encrypt a message using the Caesar cipher:
use io;
use ;
You can use python as follows:
=
# True
# True
#True
# True