Slight rework of the power of ten memo-function to ensure maximum run time for a value not in the table is O(log n) rather than O(n).  The table is partially populated during this computation rather than fully.