Freinds pairing problem

bhaiya , iska recursive solution kaise nikalu??

Aise soch ki phle tune chaha pairing krna th friends kitne bche jinse tu pairing kr skta h (n-1).
And ab soch tu single rha th bnde kitne bche (n-1), or vh (n-1) bnde kitno ke sth pairing kr skte h (n-2) ke sth.
Th recurrence kya bna
f(n) = 1*f(n-1) + (n-1)*f(n-2);
(1)*f(n-1) , pairing kri tune
(n-1)*f(n-2) , tu single rha and (n-1) ne pairing kri

bhaiya ye function of (n-1), kya denote kr rha hai ki n-1 bndo ne kitne trike se pairing ki hai

f(n-1) denote kr rha h ki (n-1) bndo ke sth kitne triko se pairing ho skti h