On Foursquare, you’ll find two different types of profile URLs. Some end in a username, while others end in a string of random numbers. People often ask how they can change from one to the other.
Your username is determined solely by the Twitter username linked to your account. If you don’t have a Twitter account linked, your user profile URL will just be a number. There is no other way to set your URL’s username.
So, if you don’t have a username and want one, you’ll have to link your Foursquare account to your Twitter account from your settings page. If you have a username and don’t want one, you’ll have to unlink your Twitter account from the same settings page.
Your username is used only in the URL for your profile page. Foursquare will always show your first and last name (or last initial to people who aren’t your friends) on your profile page and at places you’ve checked in.