The Shahnama theory is a story occurring in the epic Shahnama relating to the invention of chess.
The story relates that a very powerful King of India named Kaid, satiated with war, and having no enemies without, or rebellious subjects within his kingdom, thus addressed his minister Sassa.
"Day and night my mind is harassed with the thoughts of war and strife; when in the hours of the night sleep overpowers me, I dream of nothing but battlefields and conquests, and in the morning, when I awake, I still think over my imaginary combats and victories. Now you are well aware that I have no longer one single enemy or rebel in my whole dominions with whom to contend. It is utterly repugnant to justice and common sense, to go to war without any cause. If I were to do so God would be displeased with me, and a severe retribution for my evil deeds would soon overtake me, even in this world, for is it not said that a kingdom governed by falsehood and oppression is void of stability, and it will soon pass away. Tell me, then, O Sassa, for great is thy wisdom, what am I to do in order to regain my peace of mind, and obtain relief from my present state of weariness and disgust?"
Sassa hereupon bethought himself of a rare game, the invention of an ancient Grecian sage, by name Hermes, which had recently been introduced into India by Alexander and his soldiers, who used to play it at times of leisure. Sassa procured and modified the game and board from 56 pieces and 112 squares to 32 pieces and 64 squares, and explained it to the king, who practised it with both satisfaction and delight, Sassa's stipulation of a reward of a grain of corn doubled again and again 64 times, which was at first deemed ridiculous, was found to amount to 18,446,744,073,709,551,615.
(Adapted from Henry Bird's Chess History and Reminiscences)