#super #prime #numbers #digits #deleted #eg #remaining

nightly super-prime

Find the super prime number

2 unstable releases

0.1.0 May 6, 2023
0.0.0 May 6, 2023

#1329 in Math

27 downloads per month

MPL-2.0 license

6KB
53 lines

A super prime is a prime number that, when any of its digits is deleted, the remaining number is still prime.

eg:

  • 1 -> 19 -> 199 -> 1999 -> 13999 -> ...
  • 2 -> 29 -> 269 -> 2969 -> 25969 -> ...

So we called 25969 a super prime.

Examples

# use super_prime::{BigUint, super_prime};
let start = BigUint::from(2usize);
for n in super_prime(&start, 100).into_iter().rev() {
    println!("{}", n);
}

Dependencies

~1.5MB
~27K SLoC