Research mixing math and music finds what gives jazz that funky feeling.