Samudragupta was looking for a teacher who knew more than he did. He met a ghost who was able to do so within six months. However, he is not allowed to eat or sleep during these six months. When the time was up he fell into a deep sleep and was saved by Alangaravalli. For this she demanded that he marry her. Samudragupta refused and she complained to the king. The king ordered that he had to marry Alangaravalli, his daughter, the daughter of his minister and the daughter of his priest.

Each gave birth to a son
Alangaravalli Bhartrihari.
The daughter of King Vikramaditya.
The daughter of Minister Bhatti.
The daughter of the priest Vararuchi.

The king made Samudragupta king. Thereafter, Bhartrihari reigned. He gave the kingdom to Vikramaditya and made Bhatti minister.