I need to break a number down to be represented by a randomly ordered sequence of 2s and 3s.

For example:

* 5 can be 3,2 or 2,3
* 6 can be 3,3

I'm currently doing this with a loop in ActionScript 3 but have been looking into the possibility of using some kind of mathematical formula to save me a few lines of code. I'm a bit of a sop when it comes to Math and I've not yet found anything suitable.

Does anyone know if such a thing exists?

Thanks,

Crung