Technically you can't use all colors, a large range of those colors will clash with your design, and even worse, another large range will make the text on top hard to read, unless you also apply an algorithm to color the text in each cell to ensure higher contrast. Additionally, you need a pretty huge variance between the different colors to make them distinct. Overall it seems like too much effort for something that isn't going to look or work all that well.
I would suggest instead giving each user a randomly generated icon and displaying that icon in small to the left of their events. See the icons that Stack Overflow has? They use Gravatar. Gravatar provides several forms of randomly generated icons based on user email, and users are also free to create a Gravatar account and upload their own icon. I would strongly consider doing this instead. You could have it implemented in less than 5 minutes and be done with it.
That said, if you insist on trying it, I think the best way would be to come up with a formula that takes the auto-incremented user ID and splits up the spectrum automatically distributing the color choices as widely as possible by dividing the allowed spectrum in half repeatedly. This way the first 50 users will have the most variance in color, you will be able to predictably determine each user's color at any time, and it will otherwise be pretty random.
Regarding an algorithm for coloring text to give high contrast, that's a whole other thing. I'm sure Google would yield some good results. A simple method would be to set a threshold where a color is considered light or dark, and just test the color against that - if it's light use black font, if it's dark use white font. Drop shadows could also help with legibility.