- #1
T1000
- 7
- 0
I want to calculate the amount of n digit numbers with sum s.
The idea was the number of ways to put s balls in n boxes. So there are C(n+s-1,n-1) ways to do that when n>1 and s<10. But this formula doesn't work when s>10.
I found a formula C(10n-s-1,n-1) that works for cases where s>=10 but I can't figure out how its obtained.
The idea was the number of ways to put s balls in n boxes. So there are C(n+s-1,n-1) ways to do that when n>1 and s<10. But this formula doesn't work when s>10.
I found a formula C(10n-s-1,n-1) that works for cases where s>=10 but I can't figure out how its obtained.