Skip to content

Instantly share code, notes, and snippets.

@kazuph
Created August 27, 2012 14:44
Show Gist options
  • Save kazuph/3489118 to your computer and use it in GitHub Desktop.
Save kazuph/3489118 to your computer and use it in GitHub Desktop.
ProjectEuler Problem 36
#!/usr/bin/env ruby
p (1..999_999).select{|n| n.to_s == n.to_s.reverse and n.to_s(2) == n.to_s(2).reverse}.inject(:+) # => 872187
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment