A world-weary detective and his rookie partner are caught up in a fiendish nightmare of murder and maths.