How to find values missing from a sequence?
One easy way is to generate a list of all potential documentnos and remove from that all the ones that exist:
select 'YD4BC' || generate_series(2006004, 2006015) as missing_documentno
except
select documentno from documents;