go to
smallenginesuppliers.com/
Every thing you need to know is there.
Important thing is shaft diameter & length.
If you stay within the same maker things like alternators can be swapped out.
Remember that there was a new standard for Hp ratings so an old 20 will now be 18.
Also they all turn the same speed so doubleing the engine size will do little more than use more fuel & break belts unless you regularly mow grass that is 4' tall.
They do remaindered ( surplus) engines quite cheap and you can get some real bargans particularly with the ones pulled from unsold mowers.
smallenginewarehouse.com/Repower-Old-Equipment/
Is another good site.
A lot of the different codes are just the colour of the cowel , size of the alternator or type of air filter so almost any 4617** will fit into your mower.