Actually, the LM317 isn't guaranteed to regulate properly across the temperature range, under no load conditions, unless R1 is 120R. The worst case minimum load current for the LM317 is 10mA.
I'm just going by the datasheet, which says 240 ohms is typical.
Can anyone shed some light on why the value has to be 120 ohms?
I'd like to know this too, since the datasheet doesn't elaborate on it.
It does. It just requires some trivial math and some thinking.
1. Minimum load current under worst case conditions is given as 10 mA for the LM317. The voltage between the Out and Adj pin is regulated to 1.25V. Apply Ohm's law, and pick the nearest standard resistor value, erring on the safe side. You end up with 120 Ohms.
2. The condition stated for the worst case minimum load is given as Vin - Vout = 40 V. Which happens to be the maximum allowed voltage difference between the input and output.
Now, what if you don't operate the LM317 under this extreme condition (which is a good idea)? You turn to page 7 of the datasheet, and look into the minimum operating current figure. First thing you noticed is it doesn't give the maximum, but the typical values. E.g. something like 2.9 times lower figures. Anyhow, if you look at the diagram it tells you that the required minimum operating current decreases if you use a lower Vin - Vout difference than 40V. If you just work with, lets say, a difference of 18V, you roughly end up at 1.75 mA typical current, which is roughly 5 mA maximum current. Taking the maximum current you end up with a resistor of not larger than 240 Ohm.
3) But, if you look at the example schematics some also use a 240 Ohm resistor when the difference is e.g. 30 V (e.g. figure 906303). And now you have to really read the datasheet. Most example circuits specify the LM117, not the LM317. And the LM117 requires 5 mA, not 10 mA worst case. And that results in 240 Ohm instead of
240120 Ohm.
The conclusion of all this is if you want to be on the safe side, especially if you have a large Vin - Vout difference then go with 120 Ohm. If you want to take some risk, or your Vin - Vout is anyhow 18V or lower, go with 240 Ohm. If you need low quiescent current, if you know your load consumes the required minimum current on its own, and if your Vin - Vout is not large then go with 1.2 kOhm (figure 906317). 1.2 kOhm gives you 1 mA, which is still ten times the maximum adjustment pin current. I.e. your voltage setting current still dominates the feedback loop.
EDIT: I found this thread that has some good explanations: http://forum.allaboutcircuits.com/showthread.php?t=5494
Yes, that is an easy to read, nice to swallow and pointless description.