Can anyone suggest a good way to find permutations of 12 digits, 0 to 4, totalling 24.
I.e. two such permutations:-
{2, 1, 4, 1, 2, 2, 2, 2, 2, 2, 1, 3} // Total
24
{4, 4, 4, 4, 4, 4, 0, 0, 0, 0, 0, 0} // Total
24
I am trying this, but it takes too long:-
FromDigits[{4, 4, 4, 4, 4, 4, 0, 0, 0, 0, 0, 0}, 5]
244125000
list = {};
Array[If[Total[IntegerDigits[#, 5]] == 24, list = {list, #}] &, 244125000];