func super_d(d) { var D = Str(d)*d 1..Inf -> lazy.grep {|n| Str(d * n**d).contains(D) } } for d in (2..8) { say ("#{d}: ", super_d(d).first(10)) }