By: R' Shmuel Winzelberg
Rebbe Shmuel Ehrenfeld, zt"l, writes in his Sefer 'Chasan Sofer', that there was an ancient custom in their Shul in Matersdorf, that on Shemini Atzeres after Minchah they would distribute walnuts (Egoz) and they would toss them in the courtyard of the Shul for Simchas Yom Tov. He explains that the reason that they specifically chose walnuts was because of the Halachah in Shulchan Aruch (583:2), that people are careful not to eat walnuts on Rosh Hashanah because the Gematria, the numerical value, is the same as the word Cheit – sin. Therefore, in order to publicize that they repented with love in these days, which are days of joy, and no sin is found amidst the Jews, they would specifically throw walnuts to hint that through Teshuvah, their intentional sins were converted to merits, and there was even a hint of incidental Aveirah to be found!
(U'Matuk HaOhr, Shemini Atzeres)