I've done it before, but my approach required multiple models.
The first model takes your input and summarizes by account number. There is a calculated field for the line number, and the summary lists the minimum line number.
The second model takes your input and does an external lookup to the output of the first model based on the account number and returns the minimum line number. The calculated field for sequence number is the current line number minus the minimum line number + 1.
This of course assumes that your report is sorted by account number. If it is not, then you'll need three models, the first one runs before the two models and creates a sorted excel spreadsheet that is used as input for the first and second models described.
This is a quick overview off the top of my head. Let me know if you have specific questions and I can help you work it out.
As Joey suggests, it's likely to need multiple passes. There is one glimmer of hope for a slightly easier fix, if you can get the report to behave nicely with Account number on a Page Header template, then you might be able to use the Page() and Line() functions to generate codes like you need.
But in 99% of cases, this is going to need a multi-pass approach.