A deity appeared before Kumāra-Kassapa in Andhavana and propounded a riddle:
“There is an anthill burning day and night. The brahmin said: ‘Take your spade, Sumedha (sage), and dig.’ As Sumedha dug, he came across, successively, a door-bolt, a frog, a forked passage, a strainer, a tortoise, a cleaver, a joint of meat — all of which he was told to cast out and dig on. He then came across a cobra (nāga), which he was asked not to harm, but to worship.”
At the suggestion of the deity, Kassapa related the story to the Buddha, who solved the riddle. The anthill is the body, the brahmin teacher is the Buddha, the spade is wisdom, digging means perseverance, the door-bolt is ignorance, the forked passage is doubt, the strainer is the five hindrances, the tortoise is the five aggregates, the cleaver is the fivefold sense-pleasures, the joint of meat is passionate delight (nandīrāga), and the cobra (nāga) is the Arahant. (M.i.142 ﬀ).
According to the Commentary (MA.i.340), Kumāra-Kassapa was not an Arahant at the time of the teaching of the sutta. The deity was from the Suddhāvāsā brahma world. He was one of five friends who, in the time of Kassapa Buddha, had entered the Order and who, in order to meditate uninterruptedly, had climbed a rock by means of a ladder which they had then removed, thus cutting off their return. The eldest became an Arahant in three days, the second was this deity, who had become a Non-returner. The third was Pukkusāti, the fourth Bāhiya Dārucīriya, and the fifth was Kumāra-Kassapa. This deity was responsible for the Arahantship both of Bāhiya and Kassapa, for Kassapa took the Vammika Sutta as the subject of his meditation and thus developed insight.