It is also important to note that condition IS NEW becomes TRUE only after the object instance is saved in the database. Therefore, in the rule
If Account IS NEW Then
Account.AccountNumber = COUNT Account
the COUNT will include the newly created instance, whereas in the following initialization rule
If Account.AccountNumber IS UNDEFINED Then
Account.AccountNumber = COUNT Account
which is executed before the instance is created, the COUNT value will be one less.
You may also consider a different approach to numbering:
If Account IS NEW Then
Account.AccountNumber = MAX Account.AccountNumber + 1
This approach guarantees that the new account number will be unique. It will be one more than the largest existing account number. With the 'COUNT Account' approach it is possible that more than one account is assigned the same number if the users are allowed to delete accounts from the system.