أَمْ حَسِبْتَ أَنَّ أَصْحَٰبَ ٱلْكَهْفِ وَٱلرَّقِيمِ كَانُوا۟ مِنْ ءَايَٰتِنَا عَجَبًا · إِذْ أَوَى ٱلْفِتْيَةُ إِلَى ٱلْكَهْفِ فَقَالُوا۟ رَبَّنَآ ءَاتِنَا مِن لَّدُنكَ رَحْمَةً وَهَيِّئْ لَنَا مِنْ أَمْرِنَا رَشَدًا · فَضَرَبْنَا عَلَىٰٓ ءَاذَانِهِمْ فِى ٱلْكَهْفِ سِنِينَ عَدَدًا
"Did you suppose that the People of the Cave and al-Raqīm were a wonder among Our signs? When those young men took refuge in the cave and said: 'Our Lord! Give us mercy from Your presence and prepare for us a right course in our affair.' So We struck upon their ears in the cave for a number of years."
ٱلرَّقِيم — what the word is is not known with certainty. The root ر-ق-م was treated in al-Muṭaffifīn (kitābun marqūm): to write, to mark.
The explanations transmitted in the classical commentaries: a written tablet, the name of the cave or of the valley, or the name of the dog. None of them is certain knowledge; I content myself with transmitting them.
The construction of the idiom is worth recording: the verse does not say "We put them to sleep". The veil is drawn over the ear, not over the eye.
I record this as my own reading: what breaks sleep is most often sound. And in Fuṣṣilat at 41/5 it was treated that those addressed said fī ādhāninā waqr (in our ears is a heaviness) — there it was an excuse. Here a veil struck on the same region is a protection. The two usages may be compared.
ثُمَّ بَعَثْنَٰهُمْ لِنَعْلَمَ أَىُّ ٱلْحِزْبَيْنِ أَحْصَىٰ لِمَا لَبِثُوٓا۟ أَمَدًا (12) — and the ground for the awakening: to bring out which of the two parties would better count how long the period was.
I record this as an observation: as early as the twelfth verse the subject of the story is stated to be the length of time — and the sūra will take this matter up again and again in verses 19, 25 and 26. That is, at the centre of the story stands not an extraordinary sleep but the unknowability of the length of time.