What is the significance of forty-five?
Rashi: Nine for each city, with Hakadosh-Baruch-Hu making up the tenth.
Seforno: Avraham was asking Hashem whether ten in each town is vital in order to save the town, whether it requires an Eidah (in which case forty-five will not suffice to save the fifth town),
Targum Yonasan: Avraham was pleading for fifty towns to be saved if there were fifty Tzadikim, and since Zo'ar was smaller than the other tows, he asked for it to be saved on the basis of five Tzadikim instead of ten. The regression from fifty down to ten was a matter of how many towns would be saved; four towns if there were forty Tzadikim (and Zo'ar on the basis of Hashem's Midas Rachamim); if there were thirty - three (and Tzevo'im and Zo'ar on the basis of ... ), twenty - two (and Admah, Tzevo'im and Zo'ar on the basis of Hashem's Midas Rachamim). And if there were only ten, he concluded, they would join him in prayer to save all five towns.
Why did Hashem not inform Avraham after each request that the number of Tzadikim he mentioned simply did not exist, forcing him to get up the following morning to check out Hashem's decision?