i want to count the numbers that are of 4 digits and who's sum is 9 and zero cant be one of the 4 digits.
here is my approach
im looking at this problem as the following equation : x1+x2+x3+x4=9 where 1<=xi<=9, 0<i<5.
to count the number of solutions for this equation is the same thing is what i think.
is this the right approach?
A. what numbers 1..9 add up to 9, numbers may repeat.
B. how many ways can these numbers be ordered?
Easy.
>>8692719
order does not matter all that matters that zero isnt one of the digits
>>8692687
yes only ints
>>8692725
1116 and 1161 are both valid
sum is 9
they are the same numbers in a different order.
there are 6 different combinations of 4 numbers 1..9 that add up to 9. did you find these six combinations yet?
if you have 3 of the same number within a combination it can be ordered in 4 different ways.
if you have 2 of the same number within a combination it can be ordered in 12 different ways.
Post a pic of something you value and I'll tell you the combinations.
>>8692798
That's what I value most
>>8692830
>>8692832
1116 1125 1134 1224 1233 2223
for 2 same numbers
1125, 1215, 1251, 1152, 1512, 1521, 2115, 2151, 2511, 5112, 5121, 5211
for 3 same numbers
1116, 1161, 1611, 6111
total 56 different numbers