I would use a table structure, say a SQLite database, though you could use a tied array or CSV file. I would create a table something like this:
d15 | d14 | d13_v1 | d13_v2 | d12 | d10 | check | month | year |
012212316000140 | 01221231600014 | 2212316000140 | 1221231600014 | 221231600014 | 1231600014 | 0 | 01 | 22 |
The first step to create the table would be to take the 15 digit variations and generate all the other columns for each. Move on to the 14 digit variations, see if there is a 15 digit one (select * where d14 = ?) and if not create a new row and generate as many of the other columns as you can. Keep doing this all the way. For the 13 digit variations only add the ones that can be disambiguated (as hippo and others have pointed out).
At the end you will be left with a list of 13 digit ones that haven't been added. You can look these up in the table to see possible matches but will probably need to manually sort these.