The White House acknowledged that the tweets were made, calling them "pocket tweets."
As for their content, WaPo speculates that they're two-factor authentication codes which he sent back to the SMS number that Twitter uses, rather than entering into the device he was using to log in.