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.


library(Rmpfr)
options(scipen = 999)
 
find_super_d_number <- function(d, N = 10){
 
  super_number <- c(NA)
  n = 0
  n_found = 0
 
  while(length(super_number) < N){
 
    n = n + 1
    test = d * mpfr(n, precBits = 200) ** d   #Here I augment precision
    test_formatted = .mpfr2str(test)$str      #and I extract the string from S4 class object
 
    iterable = strsplit(test_formatted, "")[[1]]
 
    if (length(iterable) < d) next
 
    for(i in d:length(iterable)){
      if (iterable[i] != d) next 
      equalities = 0
 
      for(j in 1:d) {
        if (i == j) break 
 
        if(iterable[i] == iterable[i-j])
          equalities = equalities + 1
        else break
      }
 
      if (equalities >= (d-1)) {
        n_found = n_found + 1
        super_number[n_found] = n
        break
      }
    }    
  }
 
  message(paste0("First ", N, " super-", d, " numbers:"))
  print((super_number))
 
  return(super_number)
}
 
for(d in 2:6){find_super_d_number(d, N = 10)}
 