Splitting an integer into smaller integers of defined sizes in Python
<p>I need to split an integer value of arbitrary size into smaller integers (chunks), and do it in the most efficient way. The chunks sizes I have are 1, 2, 3, 4, 6, 8, 16.</p>

<p>Let's say I need to split an integer 45: The chunks I would have would be: 16, 16, 8, 4, 1.
How would I write a Python function to do that for me?</p>