I'm trying to produce a list of number sequences, 4 numbers long that sum to a target value of 32.
The constraints are that the numbers must be min = 0.5, max = 9. The numbers can only increment in 0.5.
That is to say, I have a list of numbers (0.5, 1, 1.5, 2, 2.5, 3, etc............9). I need a list that shows every possible order permutation from this list that adds to exactly 32. The same number can appear multiple times e.g. the sequence could be 8, 8, 8, 8 = 32 or 6.5, 7.5, 9, 9 = 32
I have seen similar examples where each number can used once i.e. to match outstanding bills a statement. The key difference here is that the numbers from the list can repeat as many times as possible.
Also, order does matter for my purpose. For example I need to report 6, 8, 9, 9, as being distinct from 9, 9, 8, 6 or 8, 9, 6, 9 etc.
I recognize this will be a very long list >73,000 permutations.
Any help would be greatly appreciated.
The constraints are that the numbers must be min = 0.5, max = 9. The numbers can only increment in 0.5.
That is to say, I have a list of numbers (0.5, 1, 1.5, 2, 2.5, 3, etc............9). I need a list that shows every possible order permutation from this list that adds to exactly 32. The same number can appear multiple times e.g. the sequence could be 8, 8, 8, 8 = 32 or 6.5, 7.5, 9, 9 = 32
I have seen similar examples where each number can used once i.e. to match outstanding bills a statement. The key difference here is that the numbers from the list can repeat as many times as possible.
Also, order does matter for my purpose. For example I need to report 6, 8, 9, 9, as being distinct from 9, 9, 8, 6 or 8, 9, 6, 9 etc.
I recognize this will be a very long list >73,000 permutations.
Any help would be greatly appreciated.