def numbers_that_start_with_1
return enum_for(:numbers_that_start_with_1) unless block_given?
infty = 1.0 / 0.0
(0..infty).each do |i|
(0 .. 10**i - 1).each do |j|
yield(10**i + j)
end
end
end
numbers_that_start_with_1.first(20)
#=> [1, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 100, 101, 102, 103, 104, 105, 106, 107, 108]