If a Mac has had its logicboard replaced, it is often replaced with one with no serial number. There is no way to retrieve that serial number once that is done short of looking at its repair history from the original owner's
http://www.apple.com/support/repairstatus/
page.
You can figure out though which iMac it is following my FAQ:
http://www.macmaps.com/macosxnative.html#IDENTIFY
Once you know that, use the spec database to find out its RAM limit.
664 MB is not a RAM amount. RAM is in multiples of 32 on iMacs based on two slots. So you can have 576 MB of RAM, or you can have 640 MB of RAM.
If the amount of hard drive space free is 664 MB, it is insufficient to install Mac OS X. You'll have to free up at least 5 GB to install a current version of Mac OS X. You will also need to upgrade the firmware from:
http://docs.info.apple.com/article.html?artnum=86117
if it hasn't been already, and make sure your RAM is at least 384 MB for 10.3 and 512 MB for 10.4. If your iMac doesn't have Firewire, you can't install 10.4. If your iMac has no DVD drive, you'll need the Media Exchange program on
http://www.apple.com/macosx/upgrade 's right hand side.