Uthman bin Affan reported,

A man came to the Prophet ﷺ and said, "Messenger of Allah, I prayed but I do not know whether I prayed an even or an odd number of rakahs."The Messenger of Allah ﷺ replied, "Beware of letting Satan toy with you in your prayer. Whoever among you prays and does not know whether he prayed an even or an odd number, let him perform two prostrations, for they will complete his prayer."

Azami 2472

Hasan

عن عثمان بن عفان قال

جاء رجل إلى النبي ﷺ فقال: يا رسول الله! إني صليت فلم أدر أشفعت أم أوترت؟ فقال رسول الله ﷺ: إياي، وأن يتلعب بكم الشيطان في صلاتكم، من صلى منكم فلم يدر أشفع أو أوتر، فليسجد سجدتين، فإنهما تمام صلاته.

الأعظمي 2472حسن
Contents
Reference
Commentary
Ayat
Collection
Jami al-Kamil
Book
Prayer
Chapter
Forgetfulness
Section
Two prostrations for forgetfulness and building upon certainty
Numbering
Jami al-Kamil 2472 (2nd edition)