I've always wondered about this in regard to keyboards as well: why did anyone ever think it was a good idea to put one of the numbers out of sequence?
As for the number row, this seems to sum things up nicely: http://ux.stackexchange.com/questions/39544/keyboard-number-...
Basically the 0 was added near the O because pre-zero being included typists used the capital O as zero. Thus zero was placed near O as a matter of usage.
Obviously that could never had worked on a computer keyboard, and I think the trend to supply an actual one key was in motion before keyboard-enabled computers became common. My point is that the folks who invented and (initially) used typewriters were not thinking mathematically. They were 100% concerned with getting ink on paper quickly and legibly.
1:http://upload.wikimedia.org/wikipedia/commons/f/f9/Dialog.jp...