Abdullah bin Amr bin As reported,

The Messenger of Allah ﷺ said, "I have been told that you spend the night in prayer and fast during the day."I replied, "Messenger of Allah, I intended nothing by that except good."He said, "Whoever fasts perpetually has not truly fasted. But let me guide you to fasting that equals fasting all time, three days each month."I said, "Messenger of Allah, I am able to do more than that."He said, "Then fast five days."I said, "I am able to do more than that."He said, "Then fast ten days."I said, "I am able to do more than that."He said, "Then fast the fast of Dawud عليه السلام. He used to fast one day and break his fast the next."

Nasai 2399

Sahih

أخبرنا محمد بن عبيد عن أسباط عن مطرف عن حبيب بن أبي ثابت عن أبي العباس

عن عبد الله بن عمرو قال

قال رسول الله ﷺ إنه بلغني أنك تقوم الليل وتصوم النهار قلت يا رسول الله ما أردت بذلك إلا الخير قال لا صام من صام الأبد ولكن أدلك على صوم الدهر ثلاثة أيام من الشهر قلت يا رسول الله إني أطيق أكثر من ذلك قال صم خمسة أيام قلت إني أطيق أكثر من ذلك قال فصم عشرا فقلت إني أطيق أكثر من ذلك قال صم صوم داود عليه السلام كان يصوم يوما ويفطر يوما

النسائي 2399صحيح
Contents
Reference
Commentary
Ayat
Collection
Sunan Nasai Sughra
Book
Fasting
Chapter
Fasting ten days of the month and the differences in wording among narrators of the hadith of Abdullah bin Amr concerning it
Numbering
Darussalam 2399
Nasai 2399