require 'prime'

emirp = Enumerator.new do |y|
  Prime.each do |prime|
    rev = prime.to_s.reverse.to_i
    y << prime  if rev.prime? and rev!= prime
  end
end

puts , emirp.first(20).join()
puts 
emirp.with_index(1) do |prime,i|
  print   if (7700..8000).cover?(prime)
  if i==10000
    puts , , prime
    break
  end
end