The id can be any number, sequential or not, but still ever unique.
Its sequence is not important, nor should it be seen by the end user.
Is there a reason why you want your numbers to be perfectly sequential? (I can think of several)
If you can describe that reason, we can recommend ways to handle that issue.
when i'm finding a record sometimes i need to look the previous and next record also.
That does not require a perfectly sequenced series of auto-entered serial numbers to do.
You simply need to refer to the record with the largest serial number value that is less than that of the current record to refer to the previous record or the record with the smallest serial number that is greater than that of the current record to refer to the next record.
This usually a better option as often records get deleted from the middle of the series and trying to renumber everything to eliminate the gap in the series can be a real challenge to do successfully.