2. Book of Ṣalāh

٢۔ كِتَابُ الصَّلَاةِ

2.174 [Machine] The man does not know whether he prayed three or four.

٢۔١٧٤ بَابُ الرَّجُلُ لَا يَدْرِي أَثَلَاثًا صَلَّى أَمْ أَرْبَعًا

darimi:1535Yazīd b. Hārūn > Hishām > Yaḥyá > Abū Salamah > Abū Hurayrah

Messenger of Allah ﷺ said, "When the call for prayer is made, Satan takes to his heels passing wind so that he may not hear the Adhan and when the call is finished he comes back, and when the Iqama is pronounced, Satan again takes to his heels, and when the Iqama is finished he comes back again and tries to interfere with the person and his thoughts and say, "Remember this and that (which he has not thought of before the prayer)", till the praying person forgets how much he has prayed. If anyone of you does not remember whether he has offered three or four rakʿat then he should perform two prostrations of Sahu while sitting. (Using translation from Bukhārī 1231)  

الدارمي:١٥٣٥أَخْبَرَنَا يَزِيدُ بْنُ هَارُونَ حَدَّثَنَا هِشَامٌ عَنْ يَحْيَى عَنْ أَبِي سَلَمَةَ عَنْ أَبِي هُرَيْرَةَ

عَنِ النَّبِيِّ ﷺ قَالَ إِذَا نُودِيَ بِالْأَذَانِ أَدْبَرَ الشَّيْطَانُ لَهُ ضُرَاطٌ حَتَّى لَا يَسْمَعَ الْأَذَانَ فَإِذَا قُضِيَ الْأَذَانُ أَقْبَلَ فَإِذَا ثُوِّبَ أَدْبَرَ وَإِذَا قُضِيَ التَّثْوِيبُ أَقْبَلَ حَتَّى يَخْطِرَ بَيْنَ الْمَرْءِ وَنَفْسِهِ فَيَقُولُ اذْكُرْ كَذَا اذْكُرْ كَذَا لِمَا لَمْ يَكُنْ يَذْكُرُ حَتَّى يَظَلَّ الرَّجُلُ إِنْ يَدْرِي كَمْ صَلَّى فَإِذَا لَمْ يَدْرِ أَحَدُكُمْ كَمْ صَلَّى ثَلَاثًا أَمْ أَرْبَعًا فَلْيَسْجُدْ سَجْدَتَيْنِ وَهُوَ جَالِسٌ  

darimi:1536Aḥmad b. ʿAbdullāh > ʿAbd al-ʿAzīz > Ibn Abū Salamah al-Mājishūn > Zayd b. Aslam > ʿAṭāʾ b. Yasār > Abū Saʿīd al-Khudrī

The Prophet ﷺ said: "If one of you does not know whether he prayed three or four (rak'ahs), let him pray a rak'ah then prostrate twice after that when he is sitting. Then if he prayed five (rak'ahs), they (the two prostrations) will make his prayer even-numbered, and if he had prayed four, they will annoy and humiliate the shaitan." (Using translation from Nasāʾī 1239)   

الدارمي:١٥٣٦أَخْبَرَنَا أَحْمَدُ بْنُ عَبْدِ اللَّهِ حَدَّثَنَا عَبْدُ الْعَزِيزِ هُوَ ابْنُ أَبِي سَلَمَةَ الْمَاجِشُونُ أَنْبَأَنَا زَيْدُ بْنُ أَسْلَمَ عَنْ عَطَاءِ بْنِ يَسَارٍ عَنْ أَبِي سَعِيدٍ الْخُدْرِيِّ قَالَ

قَالَ رَسُولُ اللَّهِ ﷺ «إِذَا لَمْ يَدْرِ أَحَدُكُمْ أَثَلَاثًا صَلَّى أَمْ أَرْبَعًا فَلْيَقُمْ فَلْيُصَلِّ رَكْعَةً ثُمَّ لِيَسْجُدْ بَعْدَ ذَلِكَ سَجْدَتَيْنِ فَإِنْ كَانَ صَلَّى خَمْسًا شَفَعَتَا لَهُ صَلَاتَهُ وَإِنْ كَانَ صَلَّى أَرْبَعًا كَانَتَا تَرْغِيمًا لِلشَّيْطَانِ» قَالَ أَبُو مُحَمَّد «آخُذُ بِهِ»