"research octane" and "motor octane" are two different animals - I'd have to look up the difference. The octane number you see on the pump is an average of the two.
"Octane" is derived from the difficulty in lighting the fuel - pure octane (a straight- or branched-chain hydrocarbon, C8H18) = 100. Pure hexane (another hydrocarbon - C6H14) = 0. Mixing them by percentages generates the reference scale for gasoline octane ratings (and gasoline is actually a combination of paraffinoids and aromatic esters.)
Diesel is a different fraction, and its ratings are derived from another pure hydrocarbon called "cetane" (C16H34) = 100, and a derived compound called alpha methyl napthalene = 0 (Napthalene is a derivative of Benzene - a pair of benzene rings side-by-side. The alpha-methyl part means that one of the perimeter hydrogen atoms is replaced by a methyl - CH3 - group.) Diesel is not a paraffinoid, it is actually an oil (hence, "Diesel oil" or "fuel oil,") and runs through a different combustion process. Diesel will not spark ignite, and I've seen roads flares roll into the stuff with no more effect than if it had been water. Try that with gasoline!
Octane rating really doesn't have anything to do with fuel content - a more useful specification for that is "energy content" - which is BTU potential per unit mass of fuel. Alcohol may have a lower energy content, but it also runs at a much richer stoichiometric ratio due to the oxygen bound into the fuel (nitromethane can run even richer!) Therefore, you can make more power with a properly-tuned alcohol engine, since you're wedging more energy into the cylinder - but you're burning more fuel doing it.
Of course, there are the "superfuels" - namely, AvGas (jet fuel is highly refined Kerosene, and is closer to Diesel fuel.) With an octane rating over 100, it's obvious that there's something going on there - and it's done by blending paraffinoids and combustion inhibitors.
Like I said, SAE has a number of good books on the subject (a little dry, but worth reading if you're really interested) and there's a "Gasoline FAQ" out there - I might have an Archival copy of it around here, but I won't swear to it right at the moment...
5-90