From: Frederick Cheung Date: 2008-07-12T16:46:04+09:00 Subject: Re: Symbolify (#169) On 12 Jul 2008, at 08:40, ThoML wrote: >> Or even >> symbolify(9999).length == 37 >> symbolify(999999).length == 48 >> symbolify(12345678901234567890).length == 275 >> symbolify >> (1234567899999999999999999999999999999999999901234567890).length >> ==640 >> symbolify(("9"*2100).to_i).length == 26762 > > Well, well. > > I tried the following: > > p (0..10000).to_a.inject(0) {|a, i| > s = symbolify(i) > x = eval(s) > raise "Decode failed! #{i} != #{x} : #{s}" unless i == x > a + s.size > } > > For my current solution, this prints: 556136 > 419100 for me. I'm pretty sure I've got the odd extra set of parentheses I don't really need so it should be possible to shave it down a little. Fred