Greetings Terry, and welcome to the forum
It will take a bit of digging to get the complete picture you are looking for, but I will make a few introductory remarks. If you wish to pursue the question in depth, I recommend starting with a review of
The S.E.5 File by Sturtivant and Page. This is the reference I used to compile my introductory comments, and has the most detailed breakdown I know of for production statistics of the S.E.5a.
To begin with, a total of 77 S.E.5s were orderered from the Royal Aircraft Factory. Of these 77 aircraft, 7 were equipped with the 200 hp Hispano-Suiza to bring them up to S.E.5a standard. An additional 8 aircraft were re-engined with the 200hp Hisso at the depot level, but these were not
produced to S.E.5a specifications.
The rebuild process had a significant influence on the ratio of Hispano- to Viper-engined S.E.5as in service at any given time, since it became common practice to replace the HS engine with the Viper by mid-1918.
The first production contract to the full S.E.5a standard was with Martinsyde Ltd. This contract for 200 aircraft was placed on 1 February 1917. A second contract for 200 aircraft was placed with Vickers Ltd five days later. The 200hp Hispano-Suiza engine was the nominal standard for both of these contracts, but several exceptions were made during production. In the case of Martinsyde, 13 aircraft were equipped with the Viper, and 3 aircraft were built with 180hp engines. At Vickers, where production was completed some three months earlier than at Martinsyde, 4 aircraft were built with the Viper.
The first installation of the Viper engine was under a contract for 50 aircraft with the Royal Aircraft Factory. This aircraft was delivered to the Test Squadron at Martlesham Heath on 25 August 1917.
Looking at the summary of production contracts that were actually fulfilled, as listed in the reference noted above, a total of 5148 S.E.5as were built, under 31 separate contracts. From the brief overview of the first two contracts presented above, this figure drops by three aircraft, since those aircraft built with the 180hp engines were not up to S.E.5a specification. But, if the 7 aircraft built to S.E.5a standard under the S.E.5 contracts are taken into account, total S.E.5a production rises back to 5152.
So much for introductory remarks!