A super-d number is a positive, decimal (base ten) integer   n   such that   d × nd   has at least   d   consecutive digits   d   where

   2 ≤ d ≤ 9

For instance, 753 is a super-3 number because 3 × 7533 = 1280873331.


Super-d   numbers are also shown on   MathWorld™   as   super-d    or   super-d.



Task

 Write a function/procedure/routine to find super-d numbers.
 For   d=2   through   d=6,   use the routine to show the first   10   super-d numbers.


Extra credit

 Show the first   10   super-7, super-8, and/or super-9 numbers   (optional).


See also

   Wolfram MathWorld - Super-d Number.
   OEIS: A014569 - Super-3 Numbers.


// [dependencies]
// rug = "1.9"
 
fn print_super_d_numbers(d: u32, limit: u32) {
    use rug::Assign;
    use rug::Integer;
 
    println!("First {} super-{} numbers:", limit, d);
    let digits = d.to_string().repeat(d as usize);
    let mut count = 0;
    let mut n = 1;
    let mut s = Integer::new();
    while count < limit {
        s.assign(Integer::u_pow_u(n, d));
        s *= d;
        if s.to_string().contains(&digits) {
            print!("{} ", n);
            count += 1;
        }
        n += 1;
    }
    println!();
}
 
fn main() {
    for d in 2..=9 {
        print_super_d_numbers(d, 10);
    }
}