Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- require 'Prime'
- (1..1000).each{|v| p v if v.to_s.length >= 2 && Prime.prime?(v) && v.to_s.count("1") == v.to_s.count("7") && v.to_s.count("1") == 0 && v.to_s.chars.map{|i| i.to_i}.reduce(:+) <= 10 && v.to_s[0..1].chars.map{|i| i.to_i}.reduce(:+) % 2 == 1 && v.to_s[-2].to_i % 2 == 0 && v.to_s[-1].to_i == v.to_s.length}
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement