The Jataka, Vol. IV, tr. by W.H.D. Rouse, , at sacred-texts.com
"O plunged in thought," etc.—This story the Master told while dwelling at Jetavana, about praise of his own wisdom. In the Hall of Truth they were gossiping: "See, Brothers, the Dasabala's skill in resource! He showed that young
gentleman Nanda 1 the host of nymphs, and gave him sainthood; he gave a cloth to his little foot-page 2, and bestowed sainthood on him along with the four branches of mystic science 3; to the blacksmith he showed a lotus, and gave him sainthood; with what diverse expedients he instructs living beings!" The Master entering asked what they sat talking of; they told him. Said he, "It is not the first time that the Tathāgata has been skilled in resource, and clever to know what will have the desired effect; clever he was before." So saying, he told a story of the past.
Once upon a time, when Brahmadatta was king of Benares, the country was without gold; for the king oppressed the country and so got treasure. At that time the Bodhisatta was born in a brahmin family of a certain village in Kāsi. When he came of age, he went to Takkasilā, saying, "I will get money to pay my teacher afterwards, by soliciting alms honourably." He acquired learning, and when his education was done, he said, "I will use all diligence, my teacher, to bring you the money due for your teaching." Then taking leave of him, he departed, and traversing the land sought alms. When he had honourably and fairly got a few ounces 4 of gold, he set out to hand them over to his teacher; and on the way went aboard a boat in order to cross the Ganges. As the boat swayed to and fro on the water, the gold fell in. Then he thought, "This is a country hard to get gold in;  if I go seeking again for money to pay my teacher withal, there will be long delay. What if I sit fasting on the bank of the Ganges? The king will by and bye come to learn of my sitting here, and he will send some of his courtiers, but I will have nothing to say to them. Then the king himself will come, and by that means I shall get my teacher's fee from him." So he wrapt about him his upper robe, and putting outside the sacrificial thread, sat on the bank of the Ganges, like a statue of gold upon the silver sand. The passing crowds, seeing him sit there and take no food, asked him why he sat. But he had never a word for one of them. Next day the villagers of the suburb got wind of his sitting there, and they too came and asked, but he told them no more; the villagers seeing his exhausted condition went away lamenting. On the third day came people from the city, on the fourth came the city grandees, on the fifth those about the king, on the sixth day the king sent his ministers; but to none of them would the man speak.
[paragraph continues] On the seventh day the king in alarm came to the man, and asked an explanation, reciting the first stanza:
In answer to my messages? Will you conceal your pain?"
When this he heard, the Great Being replied, "O great king! the sorrow must be told to him that is able to take it away, and to no other:" and he repeated seven stanzas:
"But whosoever can relieve one part of it by right, "The cry of jackals or of birds is understood with ease;  "A man may think, "This is my friend, my comrade, of my kin": "He who not being asked and asked again "Knowing fit time for speaking how to find, "But should he see that nothing can amend
Tell not that sorrow to a soul if he can help it not.
To him let all his wish declare each sorrow-stricken wight.
Yea, but the word of men, O King, is darker far than these. 1
But friendship goes, and often hate and enmity begin! 1
Out of due season will declare his pain,
Surely displeases those who are his friends,
And they who wish him well lament amain.
Knowing a wise man of a kindred mind,
The wise to such a one his woe declares,
In gentle words with meaning hid behind.
His hardships, and that telling them will tend
To no good issue, let the wise alone
Endure, reserved and shamefast to the end."
"But whosoever can relieve one part of it by right,
"The cry of jackals or of birds is understood with ease;
 "A man may think, "This is my friend, my comrade, of my kin":
"He who not being asked and asked again
"Knowing fit time for speaking how to find,
"But should he see that nothing can amend
 Thus did the Great Being discourse in these seven stanzas to teach the king; and then repeated four others to show his search for money to pay the teacher withal:
"Householder, courtier, man of wealth, brahmin—at every door "No power had your messengers to free me from my pain:— "But thou hast power, O mighty king! to free me from my pain,
Each town or village, craving alms, my teacher's fee to bring.
Seeking, a little gold I gained, an ounce or two, no more.
Now that is lost, O mighty king! and so I grieve full sore.
I weigh’d them well, O mighty king! so I did not explain.
For I have weighed your merit well; to you I do explain."
"Householder, courtier, man of wealth, brahmin—at every door
"No power had your messengers to free me from my pain:—
"But thou hast power, O mighty king! to free me from my pain,
When the king read his utterance, he replied, "Trouble not, brahmin, for I will give you your teacher's fee;" and he restored him two-fold.
To make this clear the Master repeated the last stanza:
(In fullest trust) of gold refined twice what he had before."
When the Great Being had thus delivered himself, he proceeded to pay his teacher's fee; and the king in like manner abode by his advice, giving alms and doing good, and ruled in righteousness. So did they both finally pass away according to their deeds.
 When the Master had ended this discourse, he said: "So, Brethren, it is not now only that the Tathāgata is fertile in resource, but he was always the same." Then he identified the Birth: "At that time Ānanda was the king, Sāriputta the teacher, and I was the young man."
140:1 Buddha's half-brother. For the allusion see No. 182, Saṃgāvācara Jātaka, and Hardy, Manual, p. 204; Warren, Buddhism in Translations, 269 ff.
140:2 Reading cullupaṭṭhākassa.
140:3 Of attha-, dhamma-, nirutti-, paṭibhāna-. For explanation of these obscure terms the reader is referred to Childers, p. 366; and Warren, Buddhism in Translations, Index s. v. "Analytical Sciences."
140:4 "Seven nikkha's." Nikkho is a variable weight, equal to 250 phalas, which we may call grains.
141:1 These two couplets occur above in No. 476 (p. 135).