I am not able to understand this question.
Friends pairing problem
The problem statement of the question is generic. But the question drops a major hint through the explanation of the sample test case.
Sample Input: 1
3
Sample Output: 4
Explanation:
{1}, {2}, {3} : all single Case1
{1}, {2,3} : 2 and 3 paired but 1 is single. Case2
{1,2}, {3} : 1 and 2 are paired but 3 is single. Case3
{1,3}, {2} : 1 and 3 are paired but 2 is single. Case4
Hence 4 cases and output is 4.
Note that {1,2} and {2,1} are considered same.
In this question you have to take the count of all possible cases where either any 2 friends can be paired or 1 friend can exist alone and the pairs are unordered,ie, {1,2}=={2,1}.