This has changed in odoo starting version 14. It can no longer be changed in the technical sequence settings.
To understand how this setting can be accessed and changed programmatically, the following might be interesting
The _compute_name
method https://stackoverflow.com/a/70749983/362951
The _get_starting_sequence
method on account.move
There is an intersting thread on github: https://github.com/odoo/odoo/issues/72486
This file is also relevant: addons/account/models/sequence_mixin.py
There are 2 relevant fields in the account_move table, sequence_prefix
and sequence_number
:

But I believe they only make sense together with the name
field in the same table, because only in the name
field you can see the exact format, including the number of digits.
So it is not just a simple function call or looking something up or changing some configuration data entry. It has become more complex.
There is also a gui workflow that is called 're-sequencing' available to help to teach odoo how to do the sequencing. First of all you need at least one or more invoices or moves in your database. Make sure the developer mode is active.
To change the account.move sequence or the sequence of the invoices, you can go to the respective journal and select the records you want to change, or all the records, if you want to re-sequence all the records. (But in many cases it is not advisable to change old entries. Maybe selecting the unposted entries could make sense.)
After selecting one or more entries the Action menu with the wheel-icon appears (you can find it above the list, between Print
and Filters
. There is an entry in it: Resequence
. Once you click on it, you will be presented with a wizard, where you can select the new format and starting number. If you confirm, the new scheme will be applied to the selected entries and also be used for future entries.