Most RRs number locos about in series when they order a bunch of similar ones. They'll usually leave blanks for future purchases. Some of them get the number series so full up that they have to stick new locos in where they can. Eventually they have a wholesale renumbering.
I'll give a few British examples.
British railways uses 5 digit numbers. The first 2 were the loco class. Sometimes they used the 3rd number for variations and special equipment. The first number gave the power class, from 0 to 6.
The Midland Railway was reputed to have one rule: there should be no gaps in the system. If a number became available, the next loco built was given it, didn't matter if it was nothing like the ones on each side.
The Great Western used the second digit to indicate wheel arrangement.
Generally, within a series locos were numbered as built, delivered or ordered; if identical locos were ordered from different builders, each would be given a series of numbers.
I read that the Pennsylvania had a bag full of vacant numbers and they were drawn randomly as the locos were ordered.
It helps if there is some relationship between the numbers and the locos. If the staff has to memorize or look up which class goes with each number, you create fatigue and errors.