The PRR used letter designations for their locomotives. Single letters for steamers (S1) and two (or more) letters for diesels (AF15, FRS16).
For the most part, the number for steamers was for the version of the engine (HP for diesels). For example, K was for the 4-6-2 wheel arrangement steamers. The first K, K2 (no K1), was built in 1910. The K4, the most successful of the Ks, was built in 1914. There was even a K5, but only two were built. A was for 0-4-0, B was for 0-6-0, E was for 4-4-2, etc.
The Q was the same, sort of. They both had 10 drivers, and being rigid framed were like 4-10-4s. The Q1, built in 1942, had the 4-6-4-4 wheel arrangement with the rear cylinders facing backwards as seen below:
This allowed huge drivers (77") for fast freight service. Unfortunately, this resulted in a smaller firebox (could not keep steam pressure up at speed), was harder on the rails, and the cylinders keep getting dirty due to the close proximity of the firebox. Only one Q1 was made.
Pennsy liked the 10 driver concept so modified the Q1 to a standard cylinder arrangement in 1944 and called it a Q2:
The 4-4-6-4 wheel arrangement resulted in smaller drivers (69") with the Q2 turning out to be one of Pennsy's most successful steamers, with 25 built.
The S engines, S1 and S2, did not follow the wheel arrangement naming. I don't have pictures of these, but the S1 was Pennsy's huge 6-4-4-6 engine built in 1939. The S1 was too big to be practical and only one was built. Since no more were to be built, the S designation was available for another engine. The S1 lasted until after WWII mainly because the Pennsy needed motive power during the war.
When the Pennsy experimented with their 6-8-6 steam turbine engine in 1944, they called it a S2. The S2 was a good engine at high speed, but very inefficient at slow speeds. Again, only one was built. The S2 was good enough to keep on the Lines West tracks because of the long straight sections where it could stay at speed. It was retired in 1949 after it was damaged.