I believe they come from ISO 15, which has a complicated formula that gives up to 7 digits and various alphabetic suffixes. Leading zeroes can be omitted, giving rise to common 3, 4, and 5-digit numbers.
Like other ISO standards, officially you have to pay a rather high price to get a copy.