Sayyiduna Abdullah bin Abbas (may Allah be pleased with them both) said: I heard the Prophet (peace and blessings be upon him) say: "When a Muslim dies and forty men who do not associate anything with Allah attend his funeral (prayer), their intercession for him is accepted."
Hadith Referenceالسنن الكبرى للبيهقي / كتاب الجنائز / 6904