Unless there's some compelling reason to keep any of the current ids, I'd just create a new sequence and then update the table id from the sequence:
Code:
CREATE SEQUENCE friends_seq;
UPDATE friends
SET id = nextval('friends_seq');
To ensure this doesn't happen again, put a unique constraint (or primary key) on the id column and use the sequence as the default value.
As artacus points out, though, if other tables rely on this id number, then this is just the tip of the iceberg.