From: Robert Dober Date: 2008-09-05T15:26:46+09:00 Subject: Re: Need a 40 LOC (ignoring comments) to be shorter -- suggestions wanted I believe it can easily be seen that a number of form xy or abc where xy and abc are not ordered in ascending order cannot yield a solution hence: ruby -e 'p (3...7).map{|x|([*3..7]-[x]).map{|y| three=[*3..7]-[x,y]; two=[x,y]; [three.join.to_s.to_i * two.join.to_s.to_i, three, two]}}.sort.first.sort.first' [16345, [4, 6, 7], [3, 5]] HTH Robert -- C'est véritablement utile puisque c'est joli. Antoine de Saint Exupéry