How can I get a random number that is constant per object in a material
OK, this is quite easily doable:


For the per-object random, go for the "Object info"-node. It has an output called "Random", which gives out float from 0 to 1.
For the per-particle random, go for the "Particle index"-node. It has an output called "Index". It gives out a number in a logical order. To create randomness, have it ran through the "Noise Texture"-nodes "vector" input. This will give you a random number (though for better randomness, I strongly advise you to crank up the "Detail value" to the maximum).


I hope this helps you.

For more useful tips about nodes, I strongly advise you to refer to Andrew Price's Cycles Input Encyclopedia (https://docs.google.com/document/d/1U6Ygtl7yBWi9MGcRfcEC7L4HPKCHH6t6nsqCfIutdFE/edit?usp=docslist_api) and Andrew Price's Cycles Shader Encyclopedia (https://docs.google.com/document/d/1U6Ygtl7yBWi9MGcRfcEC7L4HPKCHH6t6nsqCfIutdFE/edit?usp=docslist_api)