mersenne-prime-number-miller-rabin

Crates.iomersenne-prime-number-miller-rabin
lib.rsmersenne-prime-number-miller-rabin
version0.1.0
sourcesrc
created_at2023-03-28 22:17:11.751496
updated_at2023-03-28 22:17:11.751496
descriptionThis package provides function to generate Mersenne number and test primality with Miller-Rabin Algorithme
homepage
repositoryhttps://github.com/CodeSourceT/mersenne-prime-number-miller-rabin
max_upload_size
id823497
size115,362
Kerneltzo (CodeSourceT)

documentation

README

Mersenne Prime - Rust

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.

Mersenne Number

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$.

Mersenne prime - Wikipedia

Miller-Rabin Algorithm

Miller-Rabin is an algorithm check if a number is probabily prime or composite. Miller-Rabin Algorithm - Wikipedia

Package

Documentation

Check on crate.io

Install

Put this code on your Cargo.toml

[dependencies]
mersenne-prime-number-miller-rabin = "0.1.0"

Exemple

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);
Commit count: 16

cargo fmt