In the long history of India, there have appeared several kings who were highly trained in shastra (multidisciplinary sciences). Traditionally, kings underwent rigorous training in all the shastras.
The Kalyani Chalukya king, Someshvara III, wrote a voluminous encyclopedia in Sanskrit, known as Rajamanasollasa, in which he lists 100 different disciplines to be learned by kings.
Emperor Krishnadevaraya of Vijayanagara was also a prolific author who authored the Amuktamalyada.
In ancient times, many royals contributed to the Upanishads. Buddha himself was born a prince.