Caution: Translations of Quran and Ḥadīth may lead to possible misapplications and misinterpretations. This site is intended for students of sacred knowledge that are proficient in comprehending classical Arabic and have a strong foundation in Islamic sciences. Also note that religious injunctions rely on several aspects beyond what one may glean through reading individual aḥādīth.
malik:3-68Mālik > ʿAfīf b. ʿAmr al-Sahmī > ʿAṭāʾ b. Yasār > Saʾalt ʿAbdullāh b. ʿAmr b. al-ʿĀṣ And Kaʿb al-Aḥbār

Yahya related to me from Malik from Afif ibn Amr as-Sahmi that Ata ibn Yasar said, "I asked Abdullah ibn Amr ibn al-As and Kab al Ahbar about someone who was uncertain in his prayer, and did not know whether he had prayed three or four rakas. Both of them said, 'He should pray another raka and then do two sajdas from the sitting position.' "  

مالك:٣-٦٨وَحَدَّثَنِي عَنْ مَالِكٍ عَنْ عَفِيفِ بْنِ عَمْرٍو السَّهْمِيِّ عَنْ عَطَاءِ بْنِ يَسَارٍ أَنَّهُ قَالَ سَأَلْتُ عَبْدَ اللَّهِ بْنَ عَمْرِو بْنِ الْعَاصِ وَكَعْبَ الأَحْبَارِ

عَنِ الَّذِي يَشُكُّ فِي صَلاَتِهِ فَلاَ يَدْرِي كَمْ صَلَّى أَثَلاَثًا أَمْ أَرْبَعًا فَكِلاَهُمَا قَالَ لِيُصَلِّي رَكْعَةً أُخْرَى ثُمَّ لِيَسْجُدْ سَجْدَتَيْنِ وَهُوَ جَالِسٌ  


See similar narrations below:

Collected by Bayhaqī
bayhaqi:3812Mālik > ʿAfīf b. ʿAmr al-Sahmī > ʿAṭāʾ b. Yasār > Saʾalt ʿAbdullāh b. ʿAmr b. al-ʿĀṣ And Kaʿb al-Aḥbār

[Machine] About the one who doubts his prayer, he does not know whether he prayed three or four rak'ahs, both of them said: "Let him stand and pray another rak'ah and then perform two prostrations if he prayed."  

البيهقي:٣٨١٢وَبِإِسْنَادِهِ قَالَ ثنا مَالِكٌ عَنْ عَفِيفِ بْنِ عَمْرٍو السَّهْمِيِّ عَنْ عَطَاءِ بْنِ يَسَارٍ أَنَّهُ قَالَ سَأَلْتُ عَبْدَ اللهِ بْنَ عَمْرِو بْنِ الْعَاصِ وَكَعْبَ الْأَحْبَارِ

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