3

The sum of the digits in 2017 is 10. How many numbers from 2000 to 3000 also have this property, including 2017?

I used the stars and bars. The first digit (thousands digit) must be 2 (it's between 2000 and 3000), and so the rest of the 3 digits can sum up to 8. So there are 8 stars and 2 bars (you're dividing 8 among 3 groups), which gives me $\binom{10}{2} = 45$ - so there'd be 45 numbers, right? There wasn't an answer, so I wanted to check this.

space
  • 4,561
  • 1
    Yep. that's it. Good result. – Joffan Sep 14 '17 at 04:56
  • 1
    This method works really well... But in two years, it suddenly becomes less elegant. – Arthur Sep 14 '17 at 06:01
  • @Arthur can you explain what you mean? If you have any other methods, I'd be glad to know about it! – space Sep 17 '17 at 10:19
  • I'm just pointing out that if this problem was given in two years (i.e. with $2019$ instead of $2017$), you would have a total digit sum of $10$ to distribute instead of $8$, and a single digit cannot be $10$. So you would have to deal with cases that stars and bars accepts, but the problem itself doesn't, like 2-10-0-0. – Arthur Sep 17 '17 at 10:24

1 Answers1

0

Wow that's a really clever way to answer that!

I agree there's 8 stars and 2 bars. Are zeros included so you have to do the theorem 2 (according to the wiki) which is (n + k - 1) choose n? So 9 choose 2 or 36?

HJ_beginner
  • 1,715
  • But $k$ is the number of groups, which is $3$ here, so $n+k-1=8+3-1=10$ and $10 \choose 2$ is correct. The point is that you add $1$ to each group and ask that all the groups are at least $1$. That means you don't worry about putting two bars between the same pair of stars. – Ross Millikan Sep 14 '17 at 05:00
  • Oh yeah -_- my bad. It sounds like 45 is the right answer then? – HJ_beginner Sep 14 '17 at 05:30
  • Yes, it is....... – Ross Millikan Sep 14 '17 at 13:52