It is narrated from Hazrat Ata bin Yasar that I asked Sayyiduna Abdullah bin Amr bin al-As (may Allah be pleased with them both) and Ka'b al-Ahbar (may Allah have mercy on him) about a person who doubts in his prayer and does not remember whether he has prayed three rak'ahs or four. Both replied that he should pray one more rak'ah and then, while sitting, perform two prostrations of forgetfulness (sujood as-sahw).