From: Frederick Cheung Date: 2008-07-12T11:47:22+09:00 Subject: Re: [QUIZ] Symbolify (#169) On 11 Jul 2008, at 20:25, Alex LeDonne wrote: >> >> I also have a longer solution that produces relatively compact >> representations relatively quickly such that >> >> symbolify(999).length == 145 >> symbolify(9999).length == 145 >> symbolify(999999).length == 389 >> symbolify(12345678901234567890).length == 1290 >> symbolify(("9"*2100).to_i).length == 402035 >> > > After clearing a "duh" moment, I've improved these encoded lengths... > symbolify(999).length == 127 > symbolify(9999).length == 127 > symbolify(999999).length == 337 > symbolify(12345678901234567890).length == 1112 > symbolify(("9"*2100).to_i).length == 350265 I've been trying the short representations that are just plain old strings thing too. I've got it down to symbolify(9999).length == 48 symbolify(999999).length == 87 symbolify(12345678901234567890).length == 221 symbolify (1234567899999999999999999999999999999999999901234567890).length ==796 symbolify(("9"*2100).to_i).length == 33219 not quite the prettiest code you've ever seen though :-) Fred