Arturo Blanco, the (3 short, 3 long and 3 short) code is the corrupted EFi bios beep codes. It is possible that the BIOS by some EFi update. "Newer computers automatically recover from a corrupted ROM; when this occurs a progress bar appears on a grey background. Do not disturb the machine while the ROM recovery is taking place." I'd start off by resetting the SMC and PRAM. Then I'd go on checking the RAM. Remove one module at a time and isolate with one known-good memory module installed in one memory slot. Repeat by testing in other memory slots. Restart and see if that makes a difference. Check the diagnostics LED on your logic board and let us know what they display.
• Indicates that trickle voltage from power supply has been detected by logic board. This LED will remain ON whenever the iMac is connected to a working AC power source. The LED will remain on even when computer has been shut down or put to sleep. The LED will turn off only if AC power source is disconnected or power supply is faulty.
• Indicates that logic board has detected power from power supply when computer is turned on. This LED will be ON when computer is turned on and power supply and voltage regulators are working correctly.
• Indicates that computer and video card are communicating. This LED will be ON when computer is communicating properly with video card. If LEDs 1 and 2 are ON and you heard the startup sound, but LED 3 is OFF, then video card might be installed incorrectly or need replacement. Note: LED #3 is not present on models with integrated graphics.
• Indicates that computer and LCD panel are communicating. This LED will be ON when computer is turned on and video signal is being generated. If LED 4 is ON and there is no image on display, then LCD panel, LED backlight board, or cables between might be installed incorrectly or need replacement.
Last but not least, I would definitely replace the PRAM (coin) battery on your logic board. Hope this helps, good luck.