The number associated with nylon generally indicates the number of carbon atoms present in the monomer molecule.
Nylon -6 is produced from caprolactam, where the number of carbon atoms present =6
Nylon 6,10 is produced from hexamethylenediamine, which contains 6 carbon atoms and sebasic acid, which contains 10 carbon atoms.