Skip to content

Instantly share code, notes, and snippets.

@MiSawa
Created September 15, 2012 16:35
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save MiSawa/3728734 to your computer and use it in GitHub Desktop.
Save MiSawa/3728734 to your computer and use it in GitHub Desktop.
p 1.upto(9999).count{|n|
50.times.all?{
n += n.to_s.reverse.to_i
n.to_s != n.to_s.reverse
}
}
#=> 249
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment