Resistors values to use with LM317
Several people have correctly pointed out that the LM317 output voltage is affected by the Iadj current which flows in R2 (see example circuit below).

Two factors are potentially relevant for Iadj - its absolute values of 50 uA typical, 100 uA maximum, and its variation across the load range of 0.2 uA typical, 5 uA maximum. As others have noted, R2 need to be small enough such that Iadj voltage drop in R2 can be ignored or it must be allowed for. If R2 is large then the change in Iadj through R2 under load may be significant. For example, if Iadj changed by it's maximum value of 5 uA across load and if R2 was 100k (much larger than usual) then the change in Vout would be V=I.R = 5 uA.100k = 0.5Volt! Even a 20k here would cause a change of 0.1 Volt, which may be of concern in some cases. (If it was then you should probably not be using a simple 3 terminal regulator, but that's another story).



Less subtle issue: There is a second less subtle but sometimes overlooked factor. The LM317 internal electronics are "operated" by the dropout voltage across the regulator and a minimim current MUST flow through the regulator to achieve regulation.

The LM317 datasheet specifies 10 mA max, 3.5 mA typical as the minimum load current (on page 4 of the referenced datasheet). (A maximum minimum is a nice concept :-)). 'Proper' design requires that 10 mA worst case be allowed for. IF the external load always draws 10 mA or more then all is well. However, if external load current can fall to below 10 mA then the design must provide a load to provide this 10 mA. Worst case, with no load, R1 provides a convenient way of providing the 10 mA while also providing a nicely "stiff" divider. R1 will always have 1.25V across it in normal operation. Using R1 = 240 ohms as shown in the datasheet example gives I = V/R = 1.25/240 = 5.2 mA which is more than the 3.5 mA typical minimum load needed but less than the 10 mA worst case minimum load needed. If there can be zero external load then you need no more than R=V/I = 1.25V/10 mA = 125 ohm for R1 if this is the way you obtain your minimum load current. SO the 240 ohm resistor shown for R1 would not meet the LM317 minimum load requirement worst case. Either a lower value of R1 must be used or a minimum external load suitable to bring the total up to at least 10 mA must always be present.

With R1 set, R2 can now be dimensioned to achieve the desired output voltage. With 10 mA flowing in R1 + R2, Iadj is insignificantly small in all except critical cases.

When 'designing" a circuit (rather than just "making it work") it is essential that the worst case parameters are used. What constitutes 'worst" will vary with the parameter and, in some cases, you may have to use the mimimum value of a  parameter for one design calculation and the maximum value of the same parameter for another calculation.

Efficiency issues: 

"For interest" -  the LM317 has a minimum dropout voltage of about 1.5V to 2V for most of the range of conditions that would typically apply. (25C, 20 mA to 1A. ) Dropout can be as low as 1V at 20 mA at 150 C (!!!) and as high as 2.5V at 1.5A at either -50C or +150C (!). 2V is a safish value for dropout for scoping calculations. Worst case for your design needs to be established when doing final design.

At say 5V out then efficiency = &lt;= Vout/Vin = 5/(5+2) =~ 71%.

At very low currents the minimum load current of 10 mA may be significant. eg at 1 mA out efficiency = 1ma_load /10_ x 71% = mA_min = 7.1% ! :-) :-(.

At 5 mA out its 5/10 x 71% =~ 35%. 

Maximum efficiency rises towards typically 70% with increasing loads.

BUT all the above is what happens when the regulator is just at the point of "dropout". Where Vin is more than about 2V above Vout it is the regulators job to drop the excess voltage. So efficiency must be lower than the maximum possible in most cases.