Along with Diophantus mathematics has been represented in form of poems often times. Bhaskara II composes in Lilavati:
Whilst making love a necklace broke.
A row of pearls mislaid.
One sixth fell to the floor.
One fifth upon the bed.
The young woman saved one third of them.
One tenth were caught by her lover.
If six pearls remained upon the string
How many pearls were there altogether?
Or to cite from modern examples: Poetry inspired by mathematics which includes Tom Apostol's Where are the zeros of Zeta of s? to be sung to to the tune of "Sweet Betsy from Pike". Or Tom Lehrer's derivative poem here.
Thus my motivation is to compile here a collection of poems that explain relatively obscure concepts. Rap culture welcome but only if it includes homological algebra or similar theory. (Please let us not degenerate it to memes...). Let us restrict it to only one poem by answer so as to others can vote on the richness of the concept.

This is a slightly more serious answer than the rest; apologies in advance. :-)
In the question you quoted a particular problem from Bhaskara's Lilavati, but it should be noted that all the problems in Lilavati, as well as all their solutions, and all the theorems, and all the algorithms, are also in the form of metrical poetry.
In fact, this is true of much of mathematics done in India for many centuries. There were many reasons: The tradition preferred oral transmission to written, and verse is easier to remember. Also, the tradition valued having things in your head over merely knowing where to look it up — and again, for keeping something in your head without relying on external references, verse is better. Etc. So these, at least, are reasons for storing (some) mathematics as poems.
For instance, I noted recently another problem from the Lilavati, which is in the enchanting mandākrānta metre of Sanskrit:
(Yeah, you'll have to take my word that it sounds more beautiful in Sanskrit!)
(One cubit = 2 spans; this is just a quadratic equation.)
Outside the Indian tradition, one famous example that comes to mind is that when Tartaglia first came up with the method of solving a cubic equation, he left it at Cardano's house in the form of a poem (see here for translation and background):