Not really. The only "research" I did was an REU this past summer; I learned a lot, but I didn't get any new results or publish a paper. I did get a very strong recommendation from my REU advisor (not such a well known professor, by the way) - in his words, "everyone exaggerates a little." My other recommendations were from pretty well-known professors and were probably OK but not amazing, one regret I have about my undergrad career is that I didn't spend enough time "getting to know" professors (I'm terrified of a lot of them). I have a 3.89 GPA, 3.95 in the math department (which mostly gives out A's and A-'s); I took enough classes to get a solid background, but not so many that I drove myself crazy. I got a 850 on the math GRE, which probably didn't hurt. I didn't take any grad classes, but I did take some somewhat advanced classes in my field. I think my statement of purpose was pretty good and showed that I had some clue what is going on in the field (and at Stanford) and what grad school is about (I mentioned that I was excited to teach . . .).
I get the impression that it's mostly about being an American citizen, going to a very good school for undergrad and having solid coursework. I think they do want to see a decent score on the GRE, and a lot of it probably comes down to how your research interests align with faculty and how you compare with other students with the same interests (they can't accept 15 people who want to do the same thing). In any case I don't think I'm a superstar, so hopefully this is encouraging for people who are intimidated by those with 3+ years of research and 5 publications :-).