They started out selling 21 flavors but increased it to "31" in 1953. They also began the trend of letting people taste the different flavors till they found one they liked!!
Yes...the 31 is for the 31 Flavors that Baskin Robins has available in all of their stores to taste :), and what they are famous for and their personal trademark. I hope that answers your question.