note
Roy Johnson
Limbic,<br />
I've also got what I think is a perly-golfish approach. It's at least somewhat novel, even if implementation turns out to be impractical. I haven't implemented it at all, but I'll describe it here in the hope that it's interesting.
<p>
Every number is either a factorial or the integer sqrt of some other number (well, actually, every number is the latter, but some are also the former). So when you look at a number, you check to see if it's a factorial. If so, you replace it with <i>N</i>F, where <i>N</i> is what you apply the factorial function to to get your number (that is, the inverse-factorial of your number). Otherwise, you replace it with <i>X..Y</i>S, where <i>X</i> and <i>Y</i> are the minimum and maximum values that you can plug into int(sqrt()) to get your number. S and F are literal characters to indicate the operation in your solution string.
<p>
If you have already computed the solution for <i>N</i>, or for any number between <i>X</i> and <i>Y</i>, you can substitute that solution string for the number/range in your solution string and continue solving. Otherwise, you have to solve for it. If a factorial falls in your range, you replace your range with the factorial indicator as before. Otherwise, you expand your range using the inverse int(sqrt()) function.
<p>
You proceed until the number (or range) at the beginning of your solution string includes your desired base case.
<!-- Node text goes above. Div tags should contain sig only -->
<div class="pmsig"><div class="pmsig-300037">
<hr>
<small><b>Caution:</b> Contents may have been coded under pressure.</small>
</div></div>
443037
443316