Created
November 12, 2015 10:54
-
-
Save bragboy/de770dde59358f5398d9 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| (101010107..199999999).step(10) do |n| | |
| if ((n*n).to_s.gsub /(.)./,'\1') == "123456789" || (((n-4)*(n-4)).to_s.gsub /(.)./,'\1') == "123456789" | |
| puts "The unique positive number is #{n*10}" | |
| break | |
| end | |
| end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment