Date: Erev Shabbos Parshas Vayigash 5572
From: Rabbi Moshe Sofer
To: Rabbi Baruch
Rabbi Baruch asks how many penitential fasts are required for relations with a niddah. The Chasam Sofer devises a combined regimen of thirty-eight individual fasts plus one continuous two-day-and-night fast, satisfying both opinions.
Source: Shu"t Chasam Sofer OC §173