"And Barzillai the Gileadite came down from Rogelim..." (2 Samuel 19:32). Rabbi Yudan said: Five times is "Barzillai, Barzillai" written, corresponding to the five books of the Torah, to teach you that whoever attends to a righteous person at the time of his sustenance, it is accounted to him as though he had fulfilled the five books of the Torah. Rabbi Elazar said: How many inkwells are poured out, how many quills are broken, in order to write "the sons of Heth, the sons of Heth" ten times — to teach you that whoever confirms the purchase of a righteous person, it is accounted to him as though he had fulfilled the Ten Commandments.
Barzillai and the Sons of Heth Repeated as Torah and Commandments
Midrash Shmuel 27:6
וברזילי הגלעדי ירד מרוגלים וגו' (שמואל ב' י"ט ל"ב), אמר רבי יודן חמשה פעמים כתוב ברזלי ברזלי, כנגד חמשה ספרי תורה, ללמדך שכל מי שהוא נזקק לצדיק בשעת פרנסתו, מעלין עליו כאלו קיים חמשה ספרי תורה, אמר רבי אלעזר כמה דיואות משתפכות, כמה קולמוסין משתברין, (עד לא) [כדי] לכתוב בני חת בני חת עשרה פעמים, ללמדך שכל מי שהוא (מכדר) [מברר] מקחו של צדיק, מעלין עליו כאלו קיים עשרת הדברות.