The correct way to write the ordinal number for 31 is "31st".
Here's why:
* Ordinal numbers indicate position in a sequence (first, second, third, etc.).
* For most numbers ending in "1," the ordinal form is formed by adding "st".
* The exceptions are "first", "second", and "third".