It is narrated from Sayyiduna Usamah (may Allah be pleased with him) that a man came to the Prophet (peace and blessings be upon him) and said: "O Messenger of Allah! I complain to you of a whispering (waswasah) that I find in my chest. I enter into my prayer and I do not know whether I am finishing on an even (number of rak'ahs) or on an odd." The Messenger of Allah (peace and blessings be upon him) said: "When you feel that, raise your right index finger and prod it into your left thigh, and say: 'Bismillah (In the name of Allah)', for it is the knife of Satan."
Hadith Referenceالمعجم الكبير للطبراني / باب الألف / 509