Gaṅgamāla Jātaka (No.421)
The Bodhisatta once took service under Suciparivāra of Bārāṇasī, in whose household everyone kept the fast on uposatha-days. The Bodhisatta, not knowing this, went to work as usual on the fast day, but, on discovering that no one else was working and the reason for their abstention, he refused to take any food, and as a result of his fasting died in the night. He was reborn as son of the king of Bārāṇasī, and later became king under the name of Udaya. On meeting Aḍḍhamāsaka (q.v.), Udaya shared the kingdom with him, but one day Aḍḍhamāsaka, discovering that he harboured a desire to kill Udaya, renounced his kingdom and became an ascetic. When Udaya heard of this he uttered a stanza, referring to his own past life, but no one could understand the meaning of it. The queen, anxious to learn the meaning, told the king’s barber Gaṅgamāla how he might win the king’s favour, and when the king offered him a boon, Gaṅgamāla chose to have the stanza explained to him. When he learnt how Udaya had won a kingdom as a result of having kept the fast for half a day, Gaṅgamāla renounced the world and, developing asceticism, became a Pacceka Buddha. Later he visited King Udaya and taught him and his retinue, addressing the king by name. The queen-mother took offence at this and abused Gaṅgamāla, but the king begged him to forgive her. Gaṅgamāla returned to Gandhamādana, though urged by Udaya to stay in the royal park.
Ānanda was Aḍḍhamāsaka, and Rāhulamātā was the queen.
The story was related by the Buddha to some lay-followers to en-courage them in their observance of the Uposatha (J.iii.444 ﬀ). Gaṅgamāla is mentioned as an example of a man who realised the evils of craving (taṇhā) and renounced desire, e.g., J.iv.174.