Two other answers specify the algorithm for generating valid U.S. aviation IDs.
Many who view this question might also be interested to learn that the aviation scheme is part of the entire U.S. radio station identifier scheme. IDs beginning with AA-AL, K, N, and W are allocated to the U.S. (by ITU). CF-CK are used in Canada, DA-DR in Germany, etc.
Commercial broadcast stations have all letters (no digits) beginning with W, K, and N; W as the first letter is used for almost all transmitters east of the Mississippi River and (mostly) K to the west.
U.S. amateur radio operators are assigned IDs with mostly letters with one digit near the front. They are of the form L[L]DLL[L] where L is a letter and D is a digit (or occasional two digits). [L] means an optional letter. The whole ID is 4 or 5 characters. The digit is assigned by class of license and region according the this scheme.
Government, scientific, civil, and other users are assigned by other unique schemes. For example, the Oregon NOAA weather radio stations (see table of stations) all begin with 2 or 3 letters and end with 2 to 4 digits.