i = 999 j = 999 while 1 do a = i * j if a.to_s.reverse == a.to_s then puts "#{i} x #{j} = #{a}" break; elsif i == 100 i = 1000 j -= 1 end i -= 1 puts "#{i} x #{j} = #{a}" end