Problem for Mathletes: Consider the positive integers that such that its digits are either \(1, 2,\) or \( 3\). Define a function \( f \) such that \( f(N) = \) the number of positive integers consisting of only \(1, 2 ,\) and \(3\) whose digits sum to \(N\). find \( f(10) \)
cool. trying to understand what the problem wants
NO HINTS PLEASE!
274
Not cool, zarkon! Don't explain your answer yet!
This problem is giving me a headache, I'm still missing some cases.
Especially the 7 digits case!
I was able to get 194 only :(
\[1+9+42+77+30+31+4\] @Zarkon, if you could tell us how you worked it out, that would be great. Thank you!
Lets discuss it together. The maximum number of possible digits is 10, obviously: # of digits # of combinations 10: 1,1,1,1,1,1,1,1,1,1 1 9: 1,1,1,1,1,1,1,1,2 9 5: 3,3,2,1,1 OR 2,2,2,2,2 30+1 4: 3,3,3,1 4 3: - - These are probably the easy cases. I need to count for the 8, 7 and 6 digits.
use a generating function
Or you can use recurrence relation.
I used this method: 10x1 = 10 8x1 + 1x2 = C(9,1) = 9 7x1 + 1x3 = C(8,1) = 8 6x1 + 2x2 = C(8,2) = 28 5x1 + 1x3 + 1x2 = C(7,2) * C(2,1) = 21 * 2 = 42 4x1 + 2x3 = C(6,2) = 15 4x1 + 3x2 = C(7,3) = 35 3x1 + 1x3 + 2x2 = C(6,3) * C(3,1) = 20 * 3 = 60 2x1 + 2x3 + 1x2 = C(5,3) * C(3,1) = 10 * 3 = 30 2x1 + 4x2 = C(6,4) = 15 1x1 + 3x3 = C(4,3) = 4 1x1 + 1x3 + 3x2 = C(5,4) * C(4,1) = 5 * 4 = 20 2x3 + 2x2 = C(4,2) = 6 5x2 = 1 Total = 274
Join our real-time social learning platform and learn together with your friends!