One way to do this is to map sequential numbers to your 20-digit codes. That is, you start with the number 1, and you map it to a "code" that might be "1791AQFZ537Y". The number 2 would map to, say, "3894KJAC624H", etc.
You separate the problem into two pieces. First, you want to take a sequential number and make it non-sequential. You do that using a multiplicative inverse. As pointed out in the article, any two sequential values look significantly different.
But still, all you have is a number. Say that using the function above, 1 turned into 973840256539. And you want to turn that into your code that has letters and numbers. Say you want three letters followed by four numbers, etc.
Take the original number, divide by 26 and save it. The remainder will be in the range 0-25. That's your first character (0=A, 1=B, etc.) Do that twice more for the other two letters, saving the value each time you divide it. Then generate the numbers by doing the same thing four times, but using 10 as the divisor.
You'll of course have to fiddle with the encoding to make it fit your particular rules, but what I've described should give you the basic idea.
The resulting code will have the format you want, and it's also reversible. You can take the code, do the reverse of the encoding process to get a number, and then take the multiplicative inverse to get back to the original sequential number.
So if somebody makes up a code, you can quickly reverse engineer it to find the original number that it corresponds to. Say that the you decode a value and it results in the value 137894, but the highest sequential number you've used to generate a code is 50000. You know immediately that the code is not valid.
This technique is not new. It appears that YouTube uses something very similar to create their video keys. For example, the YouTube video key "tCjzSaP0XFE" is a base64-encoded long (64 bit) integer. But the number it decodes to is not the real key. The real key is a sequential number. When the video was created, they took the next sequential key, transformed it using a multiplicative inverse, and then base64 encoded the result to give the published key.