[Machine] The Messenger of Allah ﷺ said: "If any of you has doubts about his prayer and does not know how many units he has prayed, then he should pray one unit (rak'ah) and prostrate twice while sitting before the salutation (salam). If the prayer he has prayed is his fifth unit (rak'ah), then he should perform these two prostrations with intention of seeking forgiveness (tawbah) from Satan. This narration has been narrated from the hadith of Sulayman bin Bilal and Hisham bin Saad from Zaid bin Aslam from Ata bin Yasar from Abu Sa'id, connected in the chain of narrators. This has also been narrated from the hadith of Malik, attributed to the same chain of narrators."
أَنَّ رَسُولَ اللهِ ﷺ قَالَ إِذَا شَكَّ أَحَدُكُمْ فِي صَلَاتِهِ فَلَمْ يَدْرِ كَمْ صَلَّى ثَلَاثًا أَوْ أَرْبَعًا فَلْيُصَلِّ رَكْعَةً وَلْيَسْجُدْ سَجْدَتَيْنِ وَهُوَ جَالِسٌ قَبْلَ التَّسْلِيمِ فَإِنْ كَانَتِ الرَّكْعَةُ الَّتِي صَلَّى خَامِسَةً شَفَعَهَا بِهَاتَيْنِ وَإِنْ كَانَتْ رَابِعَةً فَالسَّجْدَتَانِ تَرْغِيمٌ لِلشَّيْطَانِ وَقَدْ رُوِّينَاهُ مِنْ حَدِيثِ سُلَيْمَانَ بْنِ بِلَالٍ وَهِشَامِ بْنِ سَعْدٍ عَنْ زَيْدِ بْنِ أَسْلَمَ عَنْ عَطَاءِ بْنِ يَسَارٍ عَنْ أَبِي سَعِيدٍ مَوْصُولًا وَقَدْ رُوِيَ مِنْ حَدِيثِ مَالِكٍ أَيْضًا مَوْصُولًا