You are viewing a single comment's thread. Return to all comments →
require 'prime' n = gets.to_i palindromic_primes = Prime.lazy.select { |num| num.to_s == num.to_s.reverse }.take(n) puts palindromic_primes.to_a.inspect
Seems like cookies are disabled on this browser, please enable them to open this website
Lazy Evaluation
You are viewing a single comment's thread. Return to all comments →