Created
July 21, 2013 13:43
-
-
Save tsnow/6048610 to your computer and use it in GitHub Desktop.
This file contains 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
(10000000..99999999). #change to e.g. 1000..9999 for all 4 digit, 100000..999999 for all 6 digit nums | |
select do |i| | |
start=i.to_s.split(''); | |
bk= (start.length / 2) - 1; | |
first = start[0..bk].join('').to_i; | |
last = start[-(bk+1)..-1].join('').to_i; | |
next if last > first; | |
prod = (first * last).to_s.split(''); | |
prod.sort == start.sort; | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment