Partial Serial numbers on Military Aircraft - what combination is unique?
I can only address the AF system, but I assume the other services systems are similar.  The AF serial numbers for vehicles (the system applies to all vehicles including ground vehicles) are made up of the letters "AF" followed by the contracted delivery year (2 digits) followed by a sequential number that restarts at 1 every year.  The pic below is of an F-22 assigned to the 1st Fighter Wing (the FF code).



So this aircraft was purchased in 2008. The sequence number is 161, and would have been assigned from a block of numbers provided in the contract.  The contracting officer was given the block by the office that keeps the master list.  

It's worth noting that the paperwork and the data plate is where it has to be complete. What's painted on the a/c is just used for the convenience of the crews. For some a/c such as KC-135's and B-52's whose production run was less than 10 years, they often just us the last digit of the year and the sequence number.  Most of the tankers I see have a 5 digit number that starts with 2, for 1962.  

In a fighter squadron, most 'local' documentation just refers to the last 3 digits.  example: 061 and 813 were how we referenced two of the F-16s in the test squadron.