test<br><br><div class="gmail_quote">On Sat, Feb 21, 2009 at 3:31 AM, Trip Technician <span dir="ltr"><<a href="mailto:luke.dunn@gmail.com">luke.dunn@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
anyone interested in looking at the following problem.<br>
<br>
we are trying to express numbers as minimal expressions using only the<br>
digits one two and three, with conventional arithmetic. so for<br>
instance<br>
<br>
33 = 2^(3+2)+1 = 3^3+(3*2)<br>
<br>
are both minimal, using 4 digits but<br>
<br>
33 = ((3+2)*2+1)*3<br>
<br>
using 5 is not.<br>
<br>
I have tried coding a function to return the minimal representation<br>
for any integer, but haven't cracked it so far. The naive first<br>
attempt is to generate lots of random strings, eval() them and sort by<br>
size and value. this is inelegant and slow.<br>
<br>
I have a dim intuition that it could be done with a very clever bit of<br>
recursion, but the exact form so far eludes me.<br>
<font color="#888888">--<br>
<a href="http://mail.python.org/mailman/listinfo/python-list" target="_blank">http://mail.python.org/mailman/listinfo/python-list</a><br>
</font></blockquote></div><br>