Permalink
Switch branches/tags
Nothing to show
Find file
Fetching contributors…
Cannot retrieve contributors at this time
7 lines (6 sloc) 171 Bytes
class String
def palindrome?
self == self.reverse
end
end
puts (1..1_000_000).select{ |number| number.to_s.palindrome? and number.to_s(2).palindrome? }.reduce(:+)