RosettaCodeData/Task/Super-d-numbers/Ruby/super-d-numbers.rb

6 lines
141 B
Ruby
Raw Permalink Normal View History

2023-07-01 11:58:00 -04:00
(2..8).each do |d|
rep = d.to_s * d
print "#{d}: "
puts (2..).lazy.select{|n| (d * n**d).to_s.include?(rep) }.first(10).join(", ")
end