You have to tell them you made the mistake. If you don't and the students find out that you did it on their own you will appear incompetent.
However, if you start your next class by saying "Listen guys, I made a mistake last time" and go on to explain what it was, how you did it and, most of all, why the answer you give is correct, the impression will be totally different. The students will know you are in control, you can reflect upon your work and that you are only human after all
You can gain their respect this way.