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.


program Super_D;
uses
  sysutils,gmp;
 
var
  s :ansistring;
  s_comp : ansistring;
  test : mpz_t;
  i,j,dgt,cnt : NativeUint;
Begin
  mpz_init(test);
 
  for dgt := 2 to 9 do
  Begin
    //create '22' to '999999999'    
    i := dgt;
    For j := 2 to dgt do
      i := i*10+dgt;
    s_comp := IntToStr(i);
    writeln('Finding ',s_comp,' in ',dgt,'*i**',dgt);
 
    i := dgt;
    cnt := 0;
    repeat
      mpz_ui_pow_ui(test,i,dgt);
      mpz_mul_ui(test,test,dgt);
      setlength(s,mpz_sizeinbase(test,10));
      mpz_get_str(pChar(s),10,test);
      IF Pos(s_comp,s) <> 0 then
      Begin
        write(i,' ');
        inc(cnt);
      end;
      inc(i);
    until cnt = 10;
    writeln;
  end;
  mpz_clear(test);
End.