How close do they typically need to be to cause this problem? Is an inch apart enough to avoid it?
I don't think that there is a simple fixed rule. Analogue inputs are probably the most vulnerable but RCA cables are usually well shielded for that reason. If some input cables were poorly shielded then they may pick up hum over quite a distance. Also, an unfortunate layout of your mains cables may form a good antenna for broadcasting the interference. Electromagnetic radiation can travel a long way, think of how far a radio signal can go.
Digital inputs should be immune. I have never experienced this problem with a digital input but I am quite new to sending digital audio between devices (I have had my 605 for just a few months and have not experienced this problem). If the interference is particularly bad then maybe it could cause a problem through a digital input, that's an interesting question.
It is a familiar problem with analogue inputs. Take even quite a good setup, select an analogue input but don't play anything. Turn your volume to max and you are liable to hear some hum It can take some effort playing with cables and connections to eliminate this. Records decks are particularly prone since their inputs are more sensitive than the others. Many people don't notice the problem (because they never do this test) or don't care since it is not audible at normal levels. If you do this test, don't forget to turn the volume down before playing something. I have not done this test on my Onkyo yet; maybe I will tonight.
A very simple test which would tell us a lot is: does it depend on the source? If so, which ones? Which are better and which are worse?
Slightly harder. Unplug all inputs and check for the noise. If the noise is present with no inputs connected then the problem is in the amp or the speaker or their cables.
It is possible but unlikely that the speaker cables are picking up the interference. Actually, they are more likely to pick it up than the source since they are unshielded but it is unlikely to be noticeable since speakers are very much less sensitive than amp inputs. Can you try headphones? In the unlikely case that the speaker cables are picking up the hum, you should notice that it changes as you move the cables. Do you have cables that are far too long and coiled up neatly? If for some reason you have a spare 100m of cable in the circuit and it is neatly coiled on its reel, it may pick up nicely. Oddly, if you must have loads of spare cable, it would be better in a messy heap than a neat coil. The next possibility is a very strong source of interference; you don't live close to an electricity pylon do you?
I forgot to ask, are you using wireless speakers? I have been assuming no but if you are then the game changes completely.
So, let's suppose that you get the hum with no input connected, changing source has no effect, and moving the speakers and their cables has no effect then we are down to the amp. You either have a fault in the amp (some sensitive component is poorly connected or not properly shielded) or a severe source of interference in your house. To determine this, I think that you need to move the amp. Ideally to a different house or room but even just a few feet or turning it around 90 degrees should be tried. If moving has no effect then it is pretty certainly the amp, live with it or complain to Onkyo or your dealer. If it does have an effect then try to find a location without the problem, knock down that electricity pylon, move house, or complain to Onkyo anyway since their shielding is not good enough.