The first two chapters tell how Hanak Tade Maia was traveling from Samarra to Baghdad when he met Beremiz Samir, a young lad from Khoy with amazing mathematical abilities. The traveler then invited Beremiz to come with him to Baghdad, where a man with his abilities will certainly find profitable employment. The rest of the book tells of various incidents that befell the two men along the road and in Baghdad. In all those events, Beremiz Samir uses his abilities with calculation like a magic wand to amaze and entertain people, settle disputes, and find wise and just solutions to seemingly unsolvable problems.