# List all possible license plate numbers

The length of license plate numbers is 6, with 2 letters and 4 numbers.

The first two characters are letters and the last four are numbers. Example: AA1234.

This is the code I have so far:

letterCombinations = Tuples[Alphabet[], 2];
numberCombinations = Tuples[Range[0,9], 4];


I tried to use Outer to combine the lists of letters and the lists of numbers, but it failed. How can I fix it, I want output like this:

{{a,a,1,1,1,1},......}


Is Outer a suitable?

• How did you use Outer? Please show us the attempt. Feb 20 '17 at 9:43
• As there are 6760000 possible license plates in the scheme you mentioned in the question, are you sure you really want to generate them all? If you only need a lot (but not all) maybe randomly generating as many as you need is a better solution. Try: With[{l := RandomChoice[Alphabet[]], n := RandomInteger[9]}, {l, l, n, n, n, n}] Feb 20 '17 at 9:47

I would use

a = Alphabet[]; (* letter *)
d = Range[0, 9]; (* digit *)

result = Tuples[{a, a, d, d, d, d}];


you can definitely use Outer if you prefer

a = Alphabet[];
b = Range[0,9];
list = Flatten[Outer[List, a,a,b,b,b,b], 5];
list//Length
(* 6760000 *)


Just to show how this can be done using the OP's proposed approach:

Flatten[Outer[Join, letterCombinations, numberCombinations, 1], 1]


The other responses are ~ 10x faster.