Crates.io | mersenne-prime-number-miller-rabin |
lib.rs | mersenne-prime-number-miller-rabin |
version | 0.1.0 |
source | src |
created_at | 2023-03-28 22:17:11.751496 |
updated_at | 2023-03-28 22:17:11.751496 |
description | This package provides function to generate Mersenne number and test primality with Miller-Rabin Algorithme |
homepage | |
repository | https://github.com/CodeSourceT/mersenne-prime-number-miller-rabin |
max_upload_size | |
id | 823497 |
size | 115,362 |
This package it's develop to study Mersenne prime number. It hava functions for generate Mersenne number and check if it's probabily prime with Miller-Rabin Algorithm.
Numbers of the form $M_n=2^n-1$ are called Mersenne numbers. If $M_n$ is prime, $n$ is also prime, but the converse is not true. The smallest counterexample is $M_{11}=2047=23\cdot 89$.
Miller-Rabin is an algorithm check if a number is probabily prime or composite. Miller-Rabin Algorithm - Wikipedia
Check on crate.io
Put this code on your Cargo.toml
[dependencies]
mersenne-prime-number-miller-rabin = "0.1.0"
Let's see a basic exemple
use mersenne_prime_number_miller_rabin::is_prime;
use mersenne_prime_number_miller_rabin::mersenne_number;
let one_mersenne_number = mersenne_number(61);
let is_prime_result = is_prime(one_mersenne_number);
println!("Is prime ? {} ", is_prime_result);