FWIW, DuPont's 4-digit IMR powders were numbered in the order of their development. IMR-3031 was, quite literally, the 3031st smokeless powder formulation of the Improfed Military Rifle powder series developed by DuPont. Likewise for the others: 1204 and 1185 (both now long obsolete), 4064, 4198, 4227, 4320, 4350, 4831, etc., which means there were hundreds of powder formulations that either never made it past the development stage or were simply never released in canister lots. Hodgdon's H4831 (actually produced by DuPont) was the non-canister grade IMR-4831 used during WWII to load shells for the 40mm M1936 Bofors aniti-aircraft gun. At the end of WWII, with the need for 40mm AA shells gone, the U.S. government released tons of surplus 4831 for sale. Hodgdon saw an opportunity, bought the stuff by the railcar load. As it was not "canister grade" (or, consistent from lot-to-lot), loading data had to be carefully worked up for each lot. DuPont soon realized there was a market for a canister-grade, and started producing consistent lots of the old IMR-4831 for commercial consumption.
And the rest - as they say - is history.