It is written, "And the sons of Zerah: Zimri and Ethan and Heman and Calcol and Dara, five of them in all" (1 Chronicles 2:6). What is "five of them in all"? They are all five [destined] for the World to Come. It is written "Zimri" and it is written "Achan." Rav and Samuel [differ]: one said his name was Achan, and why was he called Zimri? Because he committed a deed like that of Zimri. And one said his name was Zimri, and why was he called Achan? Because he troubled [achan, a play on the name] the sins of Israel [bringing them to a head]. Rav Huna said in the name of Rabbi Acha: "Whoever offers a thanksgiving sacrifice honors Me, and to him who orders his way I will show the salvation of God" (Psalms 50:23) — this is Achan, who slaughtered his evil inclination as a thanksgiving offering, and "orders his way" [ve-sam derekh] means that he showed the way to penitents [those who return].
Achan, Zimri, and the Man Who Showed the Way for Penitents
Yalkut Shimoni on Nach 18:12
כתיב וּבְנֵי זֶרַח זִמְרִי וְאֵיתָן וְהֵימָן וְכַלְכֹּל וָדָרַע כֻּלָּם חֲמִשָּׁה (דברי הימים א' ב, ו), מאי כלם חמשה כלם חמשה הם לעולם הבא. כתיב זמרי וכתיב עכן, רב ושמואל חד אמר עכן שמו ולמה נקרא שמו זמרי שעשה מעשה זמרי, וחד אמר זמרי שמו ולמה נקרא שמו עכן שעיכן עונותיהם של ישראל. אמר רב הונא בשם רבי אחא זובח תודה יכבדנני, זה עכן שזבח את יצרו בתודה ושם דרך שהראה דרך לשבים: