Interplay between mathematics and physics to catch the nature of a scientific breakthrough: The case of the blackbody