Completed general memoized solution for coeff-gen