solutions in python http://gist.github.com/617686 about 30 lines of code in the tersest style, 40ish in the readability-obsesssive style I prefer
I guess I could have used a faster primality test, but I didn't feel like writing anything that complex. I know there's a website out there that has a test that works for anything under about 10 billion, if memory serves, by using the probabalistic tests and doing a special check for the only exception. Heck, it even gives you the factors for the largest number in its range...