Sahih Muslim 3265
The Book of Pilgrimage
وَحَدَّثَنَاهُ ابْنُ الْمُثَنَّى، حَدَّثَنَا ابْنُ أَبِي عَدِيٍّ، عَنْ سَعِيدٍ، عَنْ قَتَادَةَ، بِهَذَا الإِسْنَادِ وَقَالَ " أَكْثَرَ مِنْ ثَلاَثٍ إِلاَّ مَعَ ذِي مَحْرَمٍ " .
This hadith has been narrated on the authority of Qatada with the same chain of transmitters and he said:" More than three (days) except in the company of a Mahram
Text from the public-domain hadith-api dataset. Numbering follows that dataset and can differ by a few from some printed editions — check the wording, not only the number.