Are you saying that you have essentially numbering starting from 0 for each of several possible document types?
This is possible but you are immediately asking for trouble to do it exactly as shown if that is a table.  (Not if it is a query from a table with more fields in it - including your sequence number and prefix.  The maintenance of these sequence numbers IF COMBINED IN A SINGLE FIELD will be more trouble than it is worth in the long run.  You can have a separate sequence number and prefix that are combined via a QUERY and make that computation easy.  The idea is that the numbers you show to the world don't have to be joined internally.  They can be combined for display purposes but keep the numbers separate for easier manipulation.
Before we get too deep in this, a question:  Are you in a situation where for some auditor will go crazy if you have non-continuous numbering?  (We need to know if that is a requirement before we advise you.)