Advice on who to ask for a letter of recommendation for phd applications?
I would put this as a comment, but I'm under 50 reputation, so here goes.
The first three professors you mentioned sound like your best bet. Thesis advisors can vouch for your ability to do mathematical research, which is the primary skill that phd programs are looking for.
It is not uncommon for people to ask professors who they only had for a class, though letters that say no more than &quot;did well in class&quot; are not very impactful. It is better if the professor oversaw some extended class project, or even better, a thesis. Remember, the phd admissions committees want students who are motivated and capable of doing research, not just doing well in the classroom.
EDIT: Additionally, I would not worry about the fact you have not kept in contact with your undergraduate thesis advisor. This is surely a common scenario.