Number of 5-card Charlie hands in blackjack A five-card Charlie in blackjack is when you have a total of 5 cards and you do not exceed a point total of 21. How many such hands are there? Of course, the natural next question concerns six-card Charlies, etc. 
It seems like one way of determining the answer might be to determine the total number of 5-card hands and then subtract out the number of hands that exceed 21, but I am at a loss as to how to do this effectively. Is there some use of the inclusion-exclusion principle at work here? The condition that the cards do not exceed 21 is the difficulty I am having a hard time addressing. Any ideas?
 A: Here is an answer by brute force enumeration of all 5-card hands, using an R program: the number of 5-card Charlie hands is 139,972.
deck <- c(rep(1:9, 4), rep(10, 16))
acceptable <- function(x) {sum(x) <= 21}
sum(combn(deck, 5, acceptable))

A: One way to classify all blackjack hands is with a generating function:
$$
   \left((x y+1) \left(x^2 y+1\right) \left(x^3 y+1\right) \left(x^4 y+1\right) \left(x^5 y+1\right) \left(x^6 y+1\right) \left(x^7 y+1\right) \left(x^8 y+1\right) \\ \left(x^9 y+1\right) \left(x^{10} y+1\right)^4\right)^4
$$
Here, the coefficient of $x^a y^b$ gives us the number of hands that add up to $a$ and contain $b$ cards. (Assuming that all aces are worth $1$.)
So we can use the following Mathematica code to extract the information we want.
First, define the generating function above:
gf = ((1 + x y) (1 + x^2 y) (1 + x^3 y) (1 + x^4 y) (1 + x^5 y) (1 + x^6 y) (1 + x^7 y) (1 + x^8 y) (1 + x^9 y) (1 + x^10 y)^4)^4;

Next, take the coefficient of $y^5$ to only look at $5$-card hands:
poly = Coefficient[gf, y^5];

Extract a list of the coefficients of $x$: this has the number of hands with each possible value.
coeffs = CoefficientList[poly, x];

Finally, add up the first $22$ coefficient (the values $0$ through $21$).
Total[coeffs[[1 ;; 22]]]

The second line can be modified in the obvious way to get different hand sizes.
A: Here's a recursive Java code
public class MSE2183749 {
    // counts hands (with permutations) attaining at most t1 points, from n cards
    public static long countp(final int t1, final int n, final int[] cards) {
        if (n > t1)         return 0;
        if (n == 0)         return 1;
        long ac = 0;
        for (int j = 1; j < cards.length && j + n - 1 <= t1; j++) {
            if (cards[j] == 0)  continue;
            int[] cards2 = Arrays.copyOf(cards, cards.length);
            cards2[j]--;
            ac += cards[j] * countp(t1 - j, n - 1, cards2);
        }
        return ac;
    }

    public static void main(String[] args) {
        long res = countp(21, 5, new int[] { 0, 4, 4, 4, 4, 4, 4, 4, 4, 4, 16 });
        System.out.println(res/(5*4*3*2));
    }
}

The result, as other answers have pointed out, is 139972
