Staying sexually active in old age is linked to higher cognitive functioning and a sharper mind.