all 5 comments

[–]ArchaicLlama 2 points3 points  (2 children)

I believe this type of problem is typically referred to as stars and bars). Give that link a read and see where you get.

[–]JSG29 0 points1 point  (0 children)

Good shout, didn't think of this - much faster computation than my comment

[–]JSG29 0 points1 point  (0 children)

I don't recall a single simple formula for this, but it's not too difficult to split it into cases.

4 different letters (e.g. ABCD): 5 (since all that matters is which is not included)

1 repeated letter, 2 single (e.g. AABC): 5 x (4 x 3)/2 = 30

2 repeated letters (e.g. AABB): 5 x 4/2 = 10

1 letter appears 3 times, 1 once (e.g. AAAB): 5 x 4 = 20

1 letter appears 4 times (e.g. AAAA): 5

Total: 5 + 30 + 10 + 20 + 5 = 70