David Cain, mathematician and enthusiast of music from medieval to jazz, who joined the department in 1967.