Kuraib (may Allah have mercy on him) says that once a son of Sayyiduna Ibn Abbas (may Allah be pleased with them both) died at the place of Qudayd or ‘Usfan. He said to me: Kuraib! Go and see how many people have gathered. I went out and saw that some people had assembled. I came back and informed him. He asked: Are they forty in number? I replied: Yes! He said: Then bring the bier out, because I heard the Prophet (peace and blessings be upon him) say: “If any Muslim dies and forty people who do not associate anything with Allah participate in his funeral, Allah will surely accept their intercession for the deceased.”
Hadith Referenceمسند احمد / ومن مسند بني هاشم / 2509