I have a number $n$ in the range $1$ - $255$. What I'm trying to do is split $n$ into the shortest list of numbers $1$ -$16$ that add up to $n$. For example, let's say $n$ is $32$. Then, we could simply use $16$ and $16$. However, if $n$ is $33$, it would be $16, 16, 1$.
Is there any simple and fast algorithm to accomplish this? I'm not even sure what to google when researching this, so even keywords and hints are a help. Thank you!