The purpose of this article is to explore the Hungarian composer György Ligeti's (1923--2006) links with mathematics. He himself wanted to pursue a career in science, and it was only because of the numerus clausus imposed on Jews that he was forced to change his path and devote himself to music. One of his great sources of inspiration was graphic art, in particular the works of Piranesi and Escher, two engravers particularly appreciated by mathematicians.